headrevs: replace a boolean match with a if/else
I missed that while doing a previous cleanup.
--- a/rust/hg-cpython/src/revlog.rs Fri Sep 27 03:55:40 2024 +0200
+++ b/rust/hg-cpython/src/revlog.rs Wed Oct 09 10:56:51 2024 +0200
@@ -828,16 +828,15 @@
stop_rev: &PyObject,
) -> PyResult<PyObject> {
let index = &*self.index(py).borrow();
- let stop_rev = match stop_rev.is_none(py) {
- false => {
- let rev = stop_rev.extract::<i32>(py)?;
- if 0 <= rev && rev < index.len() as BaseRevision {
- Some(Revision(rev))
- } else {
- None
- }
+ let stop_rev = if stop_rev.is_none(py) {
+ None
+ } else {
+ let rev = stop_rev.extract::<i32>(py)?;
+ if 0 <= rev && rev < index.len() as BaseRevision {
+ Some(Revision(rev))
+ } else {
+ None
}
- true => None,
};
let from_core = match (filtered_revs.is_none(py), stop_rev.is_none()) {
(true, true) => index.head_revs_shortcut(),