1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2024-12-15 22:37:28 +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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 {