Mercurial > public > mercurial-scm > hg-stable
diff rust/hg-core/src/operations/cat.rs @ 52777:37e9e6e1f470
rust: use methods for checked revisions
There was some code that converted Revision to UncheckedRevision with .into()
before calling a method. This change removes the .into() and calls the
corresponding method for Revision instead.
author | Mitchell Kember <mkember@janestreet.com> |
---|---|
date | Thu, 16 Jan 2025 15:42:54 -0500 |
parents | a3fa37bdb7ec |
children |
line wrap: on
line diff
--- a/rust/hg-core/src/operations/cat.rs Thu Jan 16 15:36:26 2025 -0500 +++ b/rust/hg-core/src/operations/cat.rs Thu Jan 16 15:42:54 2025 -0500 @@ -85,11 +85,8 @@ ) -> Result<CatOutput<'a>, RevlogError> { let rev = crate::revset::resolve_single(revset, repo)?; let manifest = repo.manifest_for_rev(rev.into())?; - let node = *repo - .changelog()? - .node_from_unchecked_rev(rev.into()) - .expect("should succeed when repo.manifest did"); let mut results: Vec<(&'a HgPath, Vec<u8>)> = vec![]; + let node = *repo.changelog()?.node_from_rev(rev); let mut found_any = false; files.sort_unstable();