Mercurial > hg
changeset 51980:3e135e79b7f7
headrevs: replace a boolean match with a if/else
I missed that while doing a previous cleanup.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 09 Oct 2024 10:56:51 +0200 |
parents | 609700e5d8df |
children | d07034819565 |
files | rust/hg-cpython/src/revlog.rs |
diffstat | 1 files changed, 8 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- 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(),