Skip to content

Commit

Permalink
Make rust more idomatic (#1386)
Browse files Browse the repository at this point in the history
  • Loading branch information
rongyi authored Jun 13, 2024
1 parent 0774920 commit 017b95f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion codes/rust/chapter_backtracking/permutations_i.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fn backtrack(mut state: Vec<i32>, choices: &[i32], selected: &mut [bool], res: &
backtrack(state.clone(), choices, selected, res);
// 回退:撤销选择,恢复到之前的状态
selected[i] = false;
state.remove(state.len() - 1);
state.pop();
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion codes/rust/chapter_backtracking/permutations_ii.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fn backtrack(mut state: Vec<i32>, choices: &[i32], selected: &mut [bool], res: &
backtrack(state.clone(), choices, selected, res);
// 回退:撤销选择,恢复到之前的状态
selected[i] = false;
state.remove(state.len() - 1);
state.pop();
}
}
}
Expand Down

0 comments on commit 017b95f

Please sign in to comment.