3

Rust でのバイナリ ツリーの実装を理解しようとしていますが、locate_mut関数内のスコープ マジックについて理解できません。

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
}
4

0 に答える 0