mirror of
https://github.com/krahets/hello-algo.git
synced 2024-12-25 00:26:29 +08:00
Idiomatic rust (#1364)
This commit is contained in:
parent
9e569cf520
commit
840692acce
1 changed files with 1 additions and 1 deletions
|
@ -9,7 +9,7 @@
|
||||||
/* 移动一个圆盘 */
|
/* 移动一个圆盘 */
|
||||||
fn move_pan(src: &mut Vec<i32>, tar: &mut Vec<i32>) {
|
fn move_pan(src: &mut Vec<i32>, tar: &mut Vec<i32>) {
|
||||||
// 从 src 顶部拿出一个圆盘
|
// 从 src 顶部拿出一个圆盘
|
||||||
let pan = src.remove(src.len() - 1);
|
let pan = src.pop().unwrap();
|
||||||
// 将圆盘放入 tar 顶部
|
// 将圆盘放入 tar 顶部
|
||||||
tar.push(pan);
|
tar.push(pan);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue