Avoid match expressions with reference patterns.

https://github.com/rust-lang-nursery/rust-clippy/wiki#match_ref_pats
This commit is contained in:
Dan Gohman
2018-03-15 22:38:46 -07:00
parent 99f7cb5b8d
commit 06fe3b654f
4 changed files with 61 additions and 61 deletions

View File

@@ -104,8 +104,8 @@ impl<F: Forest> NodePool<F> {
);
let mut lower = lkey;
match &self[node] {
&NodeData::Inner { size, keys, tree } => {
match self[node] {
NodeData::Inner { size, keys, tree } => {
let size = size as usize;
let capacity = tree.len();
let keys = &keys[0..size];
@@ -147,7 +147,7 @@ impl<F: Forest> NodePool<F> {
lower = upper;
}
}
&NodeData::Leaf { size, keys, .. } => {
NodeData::Leaf { size, keys, .. } => {
let size = size as usize;
let capacity = keys.borrow().len();
let keys = &keys.borrow()[0..size];
@@ -190,7 +190,7 @@ impl<F: Forest> NodePool<F> {
lower = upper;
}
}
&NodeData::Free { .. } => panic!("Free {} reached", node),
NodeData::Free { .. } => panic!("Free {} reached", node),
}
}
}