-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use macro to simplify defining Either type
- Loading branch information
1 parent
ce59713
commit c0c48a2
Showing
4 changed files
with
27 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
pub mod sam; | ||
pub mod trie; | ||
pub mod utils; | ||
|
||
use pyo3::prelude::*; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
pub use either::{ | ||
for_both, Either as CharOrByte, | ||
{Either::Left as CharSide, Either::Right as ByteSide}, | ||
}; | ||
|
||
#[macro_export] | ||
macro_rules! char_or_byte_type { | ||
($( $name:ident )::+ $(; $( $life:lifetime ),* )?) => { | ||
$crate::utils::CharOrByte< | ||
$($name)::+ < $( $($life),* ,)? char>, | ||
$($name)::+ < $( $($life),* ,)? u8>, | ||
> | ||
}; | ||
} | ||
|
||
pub use char_or_byte_type; |