Skip to content

Commit 56b007a

Browse files
authored
Merge pull request #2526 from Hywan/chore-vfs-use-std-fs-alias
chore(vfs) Use `fs` rather than `std::fs`
2 parents 67e24c3 + fde80a8 commit 56b007a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/vfs/src/host_fs.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub struct HostFileSystem;
1313

1414
impl FileSystem for HostFileSystem {
1515
fn read_dir(&self, path: &Path) -> Result<ReadDir, FsError> {
16-
let read_dir = std::fs::read_dir(path)?;
16+
let read_dir = fs::read_dir(path)?;
1717
let data = read_dir
1818
.map(|entry| -> Result<DirEntry, _> {
1919
let entry = entry?;
@@ -114,7 +114,7 @@ impl FileOpener for HostFileOpener {
114114
let read = conf.read();
115115
let write = conf.write();
116116
let append = conf.append();
117-
let mut oo = std::fs::OpenOptions::new();
117+
let mut oo = fs::OpenOptions::new();
118118
oo.read(conf.read())
119119
.write(conf.write())
120120
.create_new(conf.create_new())
@@ -172,7 +172,7 @@ impl<'de> Deserialize<'de> for HostFile {
172172
let flags = seq
173173
.next_element()?
174174
.ok_or_else(|| de::Error::invalid_length(1, &self))?;
175-
let inner = std::fs::OpenOptions::new()
175+
let inner = fs::OpenOptions::new()
176176
.read(flags & HostFile::READ != 0)
177177
.write(flags & HostFile::WRITE != 0)
178178
.append(flags & HostFile::APPEND != 0)
@@ -209,7 +209,7 @@ impl<'de> Deserialize<'de> for HostFile {
209209
}
210210
let host_path = host_path.ok_or_else(|| de::Error::missing_field("host_path"))?;
211211
let flags = flags.ok_or_else(|| de::Error::missing_field("flags"))?;
212-
let inner = std::fs::OpenOptions::new()
212+
let inner = fs::OpenOptions::new()
213213
.read(flags & HostFile::READ != 0)
214214
.write(flags & HostFile::WRITE != 0)
215215
.append(flags & HostFile::APPEND != 0)
@@ -329,7 +329,7 @@ impl VirtualFile for HostFile {
329329
}
330330

331331
fn unlink(&mut self) -> Result<(), FsError> {
332-
std::fs::remove_file(&self.host_path).map_err(Into::into)
332+
fs::remove_file(&self.host_path).map_err(Into::into)
333333
}
334334
fn sync_to_disk(&self) -> Result<(), FsError> {
335335
self.inner.sync_all().map_err(Into::into)

0 commit comments

Comments
 (0)