fix clippy lints introduced in 1.72 and 1.73 (#2581)

fixes:
- [non_canonical_clone_impl](https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_clone_impl)
- [non_canonical_partial_ord_impl](https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl)
- [redundant_guards](https://rust-lang.github.io/rust-clippy/master/index.html#redundant_guards)
This commit is contained in:
exrook
2023-10-22 15:25:29 -04:00
committed by GitHub
parent 19209b67d2
commit 17dfdb9365
2 changed files with 3 additions and 8 deletions

View File

@@ -41,10 +41,7 @@ pub struct Handle<T> {
impl<T> Clone for Handle<T> {
fn clone(&self) -> Self {
Handle {
index: self.index,
marker: self.marker,
}
*self
}
}
@@ -60,7 +57,7 @@ impl<T> Eq for Handle<T> {}
impl<T> PartialOrd for Handle<T> {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
self.index.partial_cmp(&other.index)
Some(self.cmp(other))
}
}

View File

@@ -350,9 +350,7 @@ impl<'a> Lexer<'a> {
&mut self,
) -> Result<(&'a str, Span), Error<'a>> {
match self.next() {
(Token::Word(word), span) if word == "_" => {
Err(Error::InvalidIdentifierUnderscore(span))
}
(Token::Word("_"), span) => Err(Error::InvalidIdentifierUnderscore(span)),
(Token::Word(word), span) if word.starts_with("__") => {
Err(Error::ReservedIdentifierPrefix(span))
}