Make rust more idomatic

This commit is contained in:
rongyi 2024-06-11 18:59:08 +08:00
parent 0774920d7f
commit d2c4653396
2 changed files with 2 additions and 2 deletions

View File

@ -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();
}
}
}

View File

@ -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();
}
}
}