Update clippy settings and fix a few clippy warnings.
This commit is contained in:
@@ -17,10 +17,7 @@
|
||||
#![warn(unused_import_braces)]
|
||||
#![cfg_attr(feature = "std", warn(unstable_features))]
|
||||
#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))]
|
||||
#![cfg_attr(
|
||||
feature = "cargo-clippy",
|
||||
allow(new_without_default, new_without_default_derive)
|
||||
)]
|
||||
#![cfg_attr(feature = "cargo-clippy", allow(clippy::new_without_default))]
|
||||
#![cfg_attr(
|
||||
feature = "cargo-clippy",
|
||||
warn(
|
||||
|
||||
@@ -284,7 +284,7 @@ where
|
||||
///
|
||||
/// If the cursor reaches the end, return `None` and leave the cursor at the off-the-end
|
||||
/// position.
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(should_implement_trait))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(clippy::should_implement_trait))]
|
||||
pub fn next(&mut self) -> Option<(K, V)> {
|
||||
self.path.next(self.pool)
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ impl<F: Forest> NodePool<F> {
|
||||
pub fn free_tree(&mut self, node: Node) {
|
||||
if let NodeData::Inner { size, tree, .. } = self[node] {
|
||||
// Note that we have to capture `tree` by value to avoid borrow checker trouble.
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(needless_range_loop))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(clippy::needless_range_loop))]
|
||||
for i in 0..usize::from(size + 1) {
|
||||
// Recursively free sub-trees. This recursion can never be deeper than `MAX_PATH`,
|
||||
// and since most trees have less than a handful of nodes, it is worthwhile to
|
||||
|
||||
@@ -225,7 +225,7 @@ where
|
||||
///
|
||||
/// If the cursor reaches the end, return `None` and leave the cursor at the off-the-end
|
||||
/// position.
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(should_implement_trait))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(clippy::should_implement_trait))]
|
||||
pub fn next(&mut self) -> Option<K> {
|
||||
self.path.next(self.pool).map(|(k, _)| k)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user