Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
koeppl committed Feb 5, 2024
1 parent 9622a31 commit fc83725
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
2 changes: 0 additions & 2 deletions src/bin/count_z.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ fn compute_lz77(
debug_assert_eq!(
ret,
(psv_sa_position + 1..sa_position + 1)
.into_iter()
.map(|x| { lcp[x] })
.min()
.unwrap()
Expand All @@ -79,7 +78,6 @@ fn compute_lz77(
debug_assert_eq!(
ret,
(sa_position + 1..nsv_sa_position + 1)
.into_iter()
.map(|x| { lcp[x] })
.min()
.unwrap()
Expand Down
16 changes: 13 additions & 3 deletions src/bin/escape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,19 @@ fn main() {
let mut writer = io::stream_or_stdout(core::stringopt_stropt(&args.outfilename));

//@ sanity checks
assert_eq!(args.from_symbols.len(), args.to_symbols.len(), "The set of --from and --to symbols must be of equal size!");
assert!(!args.from_symbols.contains(&args.escape_symbol), "The set of --from symbols must not contain the escape symbol!");
assert!(!args.to_symbols.contains(&args.escape_symbol), "The set of --to symbols must not contain the escape symbol!");
assert_eq!(
args.from_symbols.len(),
args.to_symbols.len(),
"The set of --from and --to symbols must be of equal size!"
);
assert!(
!args.from_symbols.contains(&args.escape_symbol),
"The set of --from symbols must not contain the escape symbol!"
);
assert!(
!args.to_symbols.contains(&args.escape_symbol),
"The set of --to symbols must not contain the escape symbol!"
);
assert!(!args
.from_symbols
.iter()
Expand Down
3 changes: 1 addition & 2 deletions src/bin/is_stringattractor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ fn lcp_intervals(text: &[u8], sa: &[i32], lcp: &[u32]) -> Vec<SuffixEdge> {
}
let mut child_ptr: Option<Rc<RefCell<LCPInterval>>> = None;
// treat remaining nodes on `path`
while !path.is_empty() {
let node = path.pop().unwrap();
while let Some(node) = path.pop() {
node.borrow_mut().end = (n - 1) as u32;
if let Some(child) = &child_ptr {
let label =
Expand Down
5 changes: 4 additions & 1 deletion src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ pub fn bwt_from_text_by_sa(text: &Vec<u8>) -> Vec<u8> {
assert_gt!(!text.len(), 0);
let n = text.len();
let mut sa = vec![0; n];
assert!(!text[..text.len() - 1].iter().any(|&x| x == 0), "the input text contains bytes equal to zero!");
assert!(
!text[..text.len() - 1].iter().any(|&x| x == 0),
"the input text contains bytes equal to zero!"
);
cdivsufsort::sort_in_place(text, sa.as_mut_slice());
let mut bwt = vec![text[0]; n];
// let mut rsa = vec![0; n];
Expand Down

0 comments on commit fc83725

Please sign in to comment.