Error: closure requires unique access to `self` but `self` is already borrowed
问题 I'm learning Rust, and have decided to implement a piece table (described in section 6.4 of this pdf) since it's fairly simple, but non-trivial. It's mostly been pretty straightforward, but I've run into one issue I'm not really able to figure out. Here's a simplified version of my code, for reference: use std::ops::Index; #[derive(Debug)] pub struct PieceTable { // original file data: never changes orig_buffer: Vec<u8>, // all new data is pushed onto this buffer add_buffer: Vec<u8>, // the