Fix clippy warnings
This commit is contained in:
parent
b8701fcf18
commit
1f0707e1ac
3 changed files with 4 additions and 9 deletions
|
|
@ -95,7 +95,7 @@ pub fn build_lex_table(
|
|||
let mut characters = CharacterSet::empty();
|
||||
for (chars, action) in &state.advance_actions {
|
||||
if action.in_main_token {
|
||||
characters = characters.add(&chars);
|
||||
characters = characters.add(chars);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -350,7 +350,7 @@ impl CharacterSet {
|
|||
|
||||
pub fn contains_codepoint_range(&self, seek_range: Range<u32>) -> bool {
|
||||
let ix = match self.ranges.binary_search_by(|probe| {
|
||||
if probe.start < seek_range.start {
|
||||
if probe.end <= seek_range.start {
|
||||
Ordering::Less
|
||||
} else if probe.start > seek_range.start {
|
||||
Ordering::Greater
|
||||
|
|
@ -366,12 +366,7 @@ impl CharacterSet {
|
|||
}
|
||||
|
||||
pub fn contains(&self, c: char) -> bool {
|
||||
self.contains_code(c as u32)
|
||||
}
|
||||
|
||||
fn contains_code(&self, c: u32) -> bool {
|
||||
// self.ranges.iter().any(|r| r.start <= c && r.end >= c)
|
||||
self.ranges.iter().any(|r| r.contains(&c))
|
||||
self.contains_codepoint_range(c as u32..c as u32 + 1)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -716,7 +716,7 @@ impl Generator {
|
|||
if simplified_chars.range_count() >= super::build_tables::LARGE_CHARACTER_RANGE_COUNT {
|
||||
for (ix, (_, set)) in self.large_character_sets.iter().enumerate() {
|
||||
chars_copy.assign(&simplified_chars);
|
||||
large_set.assign(&set);
|
||||
large_set.assign(set);
|
||||
let intersection = chars_copy.remove_intersection(&mut large_set);
|
||||
if !intersection.is_empty() {
|
||||
let additions = chars_copy.simplify_ignoring(&ruled_out_chars);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue