Skip to content

Commit

Permalink
refactor: by clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
tu6ge committed Aug 29, 2024
1 parent ec1d95e commit ec3117b
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/rule/available/email/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,16 @@ impl<'a> Cursor<'a> {
let mut current_usize = start_usize;
loop {
match iter.next() {
Some((last_usize, con)) => match con {
'a'..='z' | 'A'..='Z' | '0'..='9' | '-' => {
current_usize = last_usize;
self.char.next();
}
_ => {
let name = &self.email_str[start_usize..current_usize + 1];
let token = EmailToken::DomainPart(name.to_string());
self.token.push(token.clone());
return Some(token);
}
},
Some((last_usize, 'a'..='z' | 'A'..='Z' | '0'..='9' | '-')) => {
current_usize = last_usize;
self.char.next();
}
Some((last_usize, _)) => {

Check failure on line 114 in src/rule/available/email/parse.rs

View workflow job for this annotation

GitHub Actions / test

unused variable: `last_usize`
let name = &self.email_str[start_usize..current_usize + 1];
let token = EmailToken::DomainPart(name.to_string());
self.token.push(token.clone());
return Some(token);
}
None => {
let name = &self.email_str[start_usize..current_usize + 1];
let token = EmailToken::DomainPart(name.to_string());
Expand Down

0 comments on commit ec3117b

Please sign in to comment.