feat(fs): add TempFileSystem::as_real()
This commit is contained in:
parent
d58ec0eba2
commit
e25531df61
2 changed files with 12 additions and 0 deletions
|
@ -21,6 +21,11 @@ impl TempFileSystem {
|
||||||
_temp_dir: temp_dir,
|
_temp_dir: temp_dir,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Create a clone of the wrapped [FileSystem].
|
||||||
|
pub fn as_real(&self) -> FileSystem {
|
||||||
|
self.real.clone()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
impl std::ops::Deref for TempFileSystem {
|
impl std::ops::Deref for TempFileSystem {
|
||||||
type Target = FileSystem;
|
type Target = FileSystem;
|
||||||
|
|
|
@ -9,6 +9,13 @@ mod path {
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn temp_as_real() {
|
||||||
|
let fs = fs::temp().expect("temp fs");
|
||||||
|
let read = fs.as_real();
|
||||||
|
|
||||||
|
assert_eq!(read.base(), fs.base());
|
||||||
|
}
|
||||||
mod is_link {
|
mod is_link {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue