【发布时间】:2019-08-13 02:09:59
【问题描述】:
fn main() {
let mut a = String::from("dd");
let mut x = move || {
a.push_str("string: &str");
};
x();
x();
}
我在此处添加了move 以捕获a,但我仍然可以调用x 闭包两次。 a 仍然在这里作为可变引用借用吗?为什么move 不强制移动?
【问题讨论】:
标签: rust closures move-semantics