mirror of
https://github.com/krahets/hello-algo.git
synced 2024-12-25 00:06:28 +08:00
Make rust more idomatic (#1386)
This commit is contained in:
parent
0774920d7f
commit
017b95f003
2 changed files with 2 additions and 2 deletions
|
@ -23,7 +23,7 @@ fn backtrack(mut state: Vec<i32>, choices: &[i32], selected: &mut [bool], res: &
|
||||||
backtrack(state.clone(), choices, selected, res);
|
backtrack(state.clone(), choices, selected, res);
|
||||||
// 回退:撤销选择,恢复到之前的状态
|
// 回退:撤销选择,恢复到之前的状态
|
||||||
selected[i] = false;
|
selected[i] = false;
|
||||||
state.remove(state.len() - 1);
|
state.pop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ fn backtrack(mut state: Vec<i32>, choices: &[i32], selected: &mut [bool], res: &
|
||||||
backtrack(state.clone(), choices, selected, res);
|
backtrack(state.clone(), choices, selected, res);
|
||||||
// 回退:撤销选择,恢复到之前的状态
|
// 回退:撤销选择,恢复到之前的状态
|
||||||
selected[i] = false;
|
selected[i] = false;
|
||||||
state.remove(state.len() - 1);
|
state.pop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue