Skip to content

Commit

Permalink
Idiomatic rust (krahets#1364)
Browse files Browse the repository at this point in the history
  • Loading branch information
rongyi authored May 15, 2024
1 parent 9e569cf commit 840692a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion codes/rust/chapter_divide_and_conquer/hanota.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/* 移动一个圆盘 */
fn move_pan(src: &mut Vec<i32>, tar: &mut Vec<i32>) {
// 从 src 顶部拿出一个圆盘
let pan = src.remove(src.len() - 1);
let pan = src.pop().unwrap();
// 将圆盘放入 tar 顶部
tar.push(pan);
}
Expand Down

0 comments on commit 840692a

Please sign in to comment.