Skip to content

Commit 5c1cf8d

Browse files
wanglei01jiangliu
authored andcommitted
fix warn(clippy::needless_borrow)
Signed-off-by: wanglei01 <wllenyj@linux.alibaba.com>
1 parent da6976b commit 5c1cf8d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/db-allocator/src/interval_tree.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ impl<T> Node<T> {
361361

362362
/// Update an existing entry and return the old value.
363363
fn update(&mut self, key: &Range, data: NodeState<T>) -> Option<T> {
364-
match self.0.key.cmp(&key) {
364+
match self.0.key.cmp(key) {
365365
Ordering::Equal => {
366366
match (self.0.data.as_ref(), data.as_ref()) {
367367
(NodeState::<&T>::Free, NodeState::<&T>::Free)
@@ -392,7 +392,7 @@ impl<T> Node<T> {
392392
/// Note: it doesn't return whether the key exists in the subtree, so caller need to ensure the
393393
/// logic.
394394
fn delete(mut self, key: &Range) -> (Option<T>, Option<Self>) {
395-
match self.0.key.cmp(&key) {
395+
match self.0.key.cmp(key) {
396396
Ordering::Equal => {
397397
let data = self.0.data.take();
398398
return (data.into(), self.delete_root());

0 commit comments

Comments
 (0)