diff rust/hg-core/src/revlog/changelog.rs @ 46135:cc6faec62cb7

rust: change &PathBuf parameters to &Path This is just as useful in function bodies, and a less strict requirement for callers. Differential Revision: https://phab.mercurial-scm.org/D9594
author Simon Sapin <simon.sapin@octobus.net>
date Mon, 14 Dec 2020 13:47:44 +0100
parents 88e741bf2d93
children 8a4914397d02
line wrap: on
line diff
--- a/rust/hg-core/src/revlog/changelog.rs	Wed Dec 16 21:06:29 2020 -0800
+++ b/rust/hg-core/src/revlog/changelog.rs	Mon Dec 14 13:47:44 2020 +0100
@@ -1,7 +1,7 @@
 use crate::revlog::revlog::{Revlog, RevlogError};
 use crate::revlog::NodePrefixRef;
 use crate::revlog::Revision;
-use std::path::PathBuf;
+use std::path::Path;
 
 /// A specialized `Revlog` to work with `changelog` data format.
 pub struct Changelog {
@@ -11,7 +11,7 @@
 
 impl Changelog {
     /// Open the `changelog` of a repository given by its root.
-    pub fn open(root: &PathBuf) -> Result<Self, RevlogError> {
+    pub fn open(root: &Path) -> Result<Self, RevlogError> {
         let index_file = root.join(".hg/store/00changelog.i");
         let revlog = Revlog::open(&index_file, None)?;
         Ok(Self { revlog })