diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-07-08 20:03:13 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-07-08 20:03:13 +0200 |
| commit | 5c327e249e03ac303e7fef40e2df6c6ef834db66 (patch) | |
| tree | 44e60f7ed494e1e6452f378620baa4afbc755346 /src/parse/scanner.rs | |
| parent | f85e5aac64784deac75950a1307f2ca802ad6765 (diff) | |
Switch to = for headings once again
Diffstat (limited to 'src/parse/scanner.rs')
| -rw-r--r-- | src/parse/scanner.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/parse/scanner.rs b/src/parse/scanner.rs index fad44e89..af88aa68 100644 --- a/src/parse/scanner.rs +++ b/src/parse/scanner.rs @@ -88,12 +88,12 @@ impl<'s> Scanner<'s> { /// Checks whether the next char fulfills a condition. /// - /// Returns `false` if there is no next char. - pub fn check<F>(&self, f: F) -> bool + /// Returns `default` if there is no next char. + pub fn check_or<F>(&self, default: bool, f: F) -> bool where F: FnOnce(char) -> bool, { - self.peek().map(f).unwrap_or(false) + self.peek().map_or(default, f) } /// The previous index in the source string. |
