What are the options to end a mutable borrow in Rust?
问题 I\'m strugglin\' with the borrow checker - wonder o\' wonder. While I found a solution by adding a block, I am curious if there are other ways to end a mutable borrow so the next statement can access a binding afterwards. Here\'s what I did so far: let mut canvas: Canvas = Canvas { width: 5, height: 5, array: vec![\'x\'; 5*5], }; { let mut renderer: CanvasRenderer = CanvasRenderer::new(&mut canvas); renderer.render_point(\'x\', 3, 3); } println!(\"The Value in the array is: {}\", canvas.array