1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-06-15 22:00:26 +02:00

Remove unnecessary ref mut in binary tree exercise (#1586)

There's no need for the `ref mut` in the pattern. So, let's just drop
it for the sake of simplicity.
This commit is contained in:
Martin Huschenbett
2023-12-13 18:34:18 +01:00
committed by GitHub
parent ce081b12f9
commit f37aeac3ca

View File

@ -42,7 +42,7 @@ impl<T: Ord + Copy> BinaryTree<T> {
right: BinaryTree::new(),
}));
}
Some(ref mut n) => {
Some(n) => {
if value < n.value {
n.left.insert(value);
} else if value > n.value {