diff --git a/src/arena.rs b/src/arena.rs index 3f17c57296..a9df066654 100644 --- a/src/arena.rs +++ b/src/arena.rs @@ -41,10 +41,7 @@ pub struct Handle { impl Clone for Handle { fn clone(&self) -> Self { - Handle { - index: self.index, - marker: self.marker, - } + *self } } @@ -60,7 +57,7 @@ impl Eq for Handle {} impl PartialOrd for Handle { fn partial_cmp(&self, other: &Self) -> Option { - self.index.partial_cmp(&other.index) + Some(self.cmp(other)) } } diff --git a/src/front/wgsl/parse/lexer.rs b/src/front/wgsl/parse/lexer.rs index 4654d4087f..ed273fbbb1 100644 --- a/src/front/wgsl/parse/lexer.rs +++ b/src/front/wgsl/parse/lexer.rs @@ -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)) }