-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clippy fixes #36
Clippy fixes #36
Conversation
This simplifies some signatures to remove lifetime annotations that aren't needed.
These borrows are immediately dereferenced by the compiler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! A small question below though.
@@ -246,7 +243,7 @@ mod test { | |||
fn from_shape(&mut self, depth: usize, shape: &TreeShape) -> usize { | |||
use self::TreeShape::*; | |||
match shape { | |||
&Node(ref value, ref children) if depth > 0 => { | |||
Node(value, children) if depth > 0 => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see ref
was removed in many places, is it by reference by default now? Instead of being by copy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changed some years ago as part of match ergonomics: https://rust-lang.github.io/rfcs/2005-match-ergonomics.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My Rust knowledge is completely outdated 😓 Thanks.
This is a good start on fixing things that clippy reports.