I'm trying to understand an implementation of a binary tree in Rust and I can't wrap my head around some scoping magic in the locate_mut
function:
match {anchor} {
&mut Some(ref mut node) if key != node.value.key() => {
anchor = if key < node.value.key() {
&mut node.left
} else {
&mut node.right
}
},
other @ &mut Some(_) |
other @ &mut None => return other
}