comparison rust/hg-core/src/operations/cat.rs @ 46134: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 dca9cb99971c
comparison
equal deleted inserted replaced
46133:0a4d47f4337b 46134:cc6faec62cb7
69 } 69 }
70 } 70 }
71 71
72 /// List files under Mercurial control at a given revision. 72 /// List files under Mercurial control at a given revision.
73 pub struct CatRev<'a> { 73 pub struct CatRev<'a> {
74 root: &'a PathBuf, 74 root: &'a Path,
75 /// The revision to cat the files from. 75 /// The revision to cat the files from.
76 rev: &'a str, 76 rev: &'a str,
77 /// The files to output. 77 /// The files to output.
78 files: &'a [HgPathBuf], 78 files: &'a [HgPathBuf],
79 /// The changelog file 79 /// The changelog file
86 manifest_entry: Option<ManifestEntry>, 86 manifest_entry: Option<ManifestEntry>,
87 } 87 }
88 88
89 impl<'a> CatRev<'a> { 89 impl<'a> CatRev<'a> {
90 pub fn new( 90 pub fn new(
91 root: &'a PathBuf, 91 root: &'a Path,
92 rev: &'a str, 92 rev: &'a str,
93 files: &'a [HgPathBuf], 93 files: &'a [HgPathBuf],
94 ) -> Result<Self, CatRevError> { 94 ) -> Result<Self, CatRevError> {
95 let changelog = Changelog::open(&root)?; 95 let changelog = Changelog::open(&root)?;
96 let manifest = Manifest::open(&root)?; 96 let manifest = Manifest::open(&root)?;