We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9e569cf commit 840692aCopy full SHA for 840692a
codes/rust/chapter_divide_and_conquer/hanota.rs
@@ -9,7 +9,7 @@
9
/* 移动一个圆盘 */
10
fn move_pan(src: &mut Vec<i32>, tar: &mut Vec<i32>) {
11
// 从 src 顶部拿出一个圆盘
12
- let pan = src.remove(src.len() - 1);
+ let pan = src.pop().unwrap();
13
// 将圆盘放入 tar 顶部
14
tar.push(pan);
15
}
0 commit comments