Skip to content

Commit 5d4ac65

Browse files
committed
feat(test): Offer CargPathExt for PathBuf
1 parent a2d45dc commit 5d4ac65

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

crates/cargo-test-support/src/paths.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,26 @@ impl CargoPathExt for Path {
211211
}
212212
}
213213

214+
impl CargoPathExt for PathBuf {
215+
fn rm_rf(&self) {
216+
self.as_path().rm_rf()
217+
}
218+
fn mkdir_p(&self) {
219+
self.as_path().mkdir_p()
220+
}
221+
222+
fn ls_r(&self) -> Vec<PathBuf> {
223+
self.as_path().ls_r()
224+
}
225+
226+
fn move_in_time<F>(&self, travel_amount: F)
227+
where
228+
F: Fn(i64, u32) -> (i64, u32),
229+
{
230+
self.as_path().move_in_time(travel_amount)
231+
}
232+
}
233+
214234
fn do_op<F>(path: &Path, desc: &str, mut f: F)
215235
where
216236
F: FnMut(&Path) -> io::Result<()>,

0 commit comments

Comments
 (0)