【发布时间】:2016-02-13 05:01:21
【问题描述】:
我想学习 Rust,正在编写一个小程序来处理声音问题。我有一个带有这个签名的函数:
fn edit_show(mut show: &mut Vec<Que>) {
show.sort_by(|a, b| que_ordering(&a.id, &b.id));
loop {
println!("Current ques");
for l in show {
println!("{}", que_to_line(&l));
}
}
}
我收到一个错误:
使用移动值:'show'
我找不到有关如何解决此问题的任何信息。这似乎是一个奇怪的排序错误,因为(我假设)如果我要在主函数中执行此操作,我传入的值似乎毫无用处。
【问题讨论】:
-
一个queue是"a line of people who are waiting for something",一个cue是一个"a signal [...] to a performer to begin"。 Que 不是 AFAIK 的一个词。