I am having an issue passing around an FnMut, I do not understand exactly why this does not compile
fn respond(order: Order, func: Rc<RefCell<FnMut(Order)->()>>) -> () {
let mut caller = func.borrow_mut();
caller(order);
}
error[E0596]: cannot borrow immutable borrowed content as mutable
--> src/main.rs:15:17
|
15 | caller(order);
| ^^^^^^ cannot borrow as mutable
playground link: playground