Skip to content
Snippets Groups Projects
Verified Commit fd79e184 authored by Vincent Lafeychine's avatar Vincent Lafeychine
Browse files

clippy: Fix bool_to_int_with_if

parent e9b840e4
No related branches found
No related tags found
1 merge request!44Fix most of `clippy::pedantic`
......@@ -32,7 +32,6 @@ rustflags = [
"-Aclippy::string_lit_as_bytes",
# clippy::pedantic
"-Aclippy::bool_to_int_with_if",
"-Aclippy::cast_lossless",
"-Aclippy::cloned_instead_of_copied",
"-Aclippy::default_trait_access",
......
......@@ -741,7 +741,7 @@ impl<T, P> Punctuated<T, P> {
/// This is the number of nodes of type `T`, not counting the punctuation of
/// type `P`.
pub fn len(&self) -> usize {
self.inner.len() + if self.last.is_some() { 1 } else { 0 }
self.inner.len() + usize::from(self.last.is_some())
}
/// Borrows the first element in this sequence.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment