Skip to content

Commit 243851c

Browse files
committed
Update nfa.rs
1 parent 837fd85 commit 243851c

File tree

1 file changed

+4
-4
lines changed
  • regex-automata/src/nfa/thompson

1 file changed

+4
-4
lines changed

regex-automata/src/nfa/thompson/nfa.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,13 +1471,13 @@ impl fmt::Debug for Inner {
14711471
}
14721472
let pattern_len = self.start_pattern.len();
14731473
if pattern_len > 1 {
1474-
writeln!(f, "")?;
1474+
writeln!(f)?;
14751475
for pid in 0..pattern_len {
14761476
let sid = self.start_pattern[pid];
14771477
writeln!(f, "START({:06?}): {:?}", pid, sid.as_usize())?;
14781478
}
14791479
}
1480-
writeln!(f, "")?;
1480+
writeln!(f)?;
14811481
writeln!(
14821482
f,
14831483
"transition equivalence classes: {:?}",
@@ -1819,7 +1819,7 @@ impl SparseTransitions {
18191819
&self,
18201820
unit: alphabet::Unit,
18211821
) -> Option<StateID> {
1822-
unit.as_u8().map_or(None, |byte| self.matches_byte(byte))
1822+
unit.as_u8().and_then(|byte| self.matches_byte(byte))
18231823
}
18241824

18251825
/// This follows the matching transition for a particular byte.
@@ -1909,7 +1909,7 @@ impl DenseTransitions {
19091909
&self,
19101910
unit: alphabet::Unit,
19111911
) -> Option<StateID> {
1912-
unit.as_u8().map_or(None, |byte| self.matches_byte(byte))
1912+
unit.as_u8().and_then(|byte| self.matches_byte(byte))
19131913
}
19141914

19151915
/// This follows the matching transition for a particular byte.

0 commit comments

Comments
 (0)