Rust, if else assignement "move out of borrowed content" : All right, this is a snippet of the rust code. It's an insertion on a common bst, I just want the reference to the branch on which I'll perform the insertion.
    
    struct Node {
        value: i32,
        left: Option<Box<Node>>,
        right: Option<Box<Node>>
    }

    ...
    
    fn insert(&mut self, elem: i32) {

        let ref mut a = if elem < self.value {
            self.left
        } else {
            self.right
        };

        ...

This code is invalid, after tweaking a bit I came to understand when I perform a if/else statement, rust moves the content before assigning it.

Infact this solution works

    let a = if elem < self.value {
            let ref mut b = self.left;
            b
        } else {
            let ref mut b = self.right;
            b
        };

But it's really ugly... is there a way to handle the thing without recurring to a Box? I could use a pointer, but it really looks like an overkill.