Skip to content

Commit 504f8cb

Browse files
author
Stjepan Glavina
committed
Use crate::path everywhere
1 parent f9cfee9 commit 504f8cb

22 files changed

+39
-42
lines changed

src/fs/copy.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
use std::path::Path;
2-
31
use crate::io;
2+
use crate::path::Path;
43
use crate::task::blocking;
54

65
/// Copies the contents and permissions of a file to a new location.

src/fs/create_dir.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
use std::path::Path;
2-
31
use crate::io;
2+
use crate::path::Path;
43
use crate::task::blocking;
54

65
/// Creates a new directory.

src/fs/create_dir_all.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
use std::path::Path;
2-
31
use crate::io;
2+
use crate::path::Path;
43
use crate::task::blocking;
54

65
/// Creates a new directory and all of its parents if they are missing.

src/fs/dir_builder.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
use std::path::Path;
2-
31
use cfg_if::cfg_if;
42

53
use crate::future::Future;
64
use crate::io;
5+
use crate::path::Path;
76
use crate::task::blocking;
87

98
/// A builder for creating directories with configurable options.

src/fs/dir_entry.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
use std::ffi::OsString;
22
use std::fmt;
3-
use std::path::PathBuf;
43
use std::sync::Arc;
54

65
use cfg_if::cfg_if;
76

87
use crate::fs::{FileType, Metadata};
98
use crate::io;
9+
use crate::path::PathBuf;
1010
use crate::task::blocking;
1111

1212
/// An entry in a directory.
@@ -50,7 +50,7 @@ impl DirEntry {
5050
/// # Ok(()) }) }
5151
/// ```
5252
pub fn path(&self) -> PathBuf {
53-
self.0.path()
53+
self.0.path().into()
5454
}
5555

5656
/// Reads the metadata for this entry.

src/fs/file.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use std::cmp;
33
use std::fmt;
44
use std::io::{Read as _, Seek as _, Write as _};
55
use std::ops::{Deref, DerefMut};
6-
use std::path::Path;
76
use std::pin::Pin;
87
use std::sync::atomic::{AtomicBool, Ordering};
98
use std::sync::{Arc, Mutex};
@@ -13,6 +12,7 @@ use cfg_if::cfg_if;
1312
use crate::fs::{Metadata, Permissions};
1413
use crate::future;
1514
use crate::io::{self, Read, Seek, SeekFrom, Write};
15+
use crate::path::Path;
1616
use crate::prelude::*;
1717
use crate::task::{self, blocking, Context, Poll, Waker};
1818

src/fs/hard_link.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
use std::path::Path;
2-
31
use crate::io;
2+
use crate::path::Path;
43
use crate::task::blocking;
54

65
/// Creates a hard link on the filesystem.

src/fs/open_options.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
use std::path::Path;
2-
31
use cfg_if::cfg_if;
42

53
use crate::fs::File;
64
use crate::future::Future;
75
use crate::io;
6+
use crate::path::Path;
87
use crate::task::blocking;
98

109
/// A builder for opening files with configurable options.

src/fs/read.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
use std::path::Path;
2-
31
use crate::io;
2+
use crate::path::Path;
43
use crate::task::blocking;
54

65
/// Reads the entire contents of a file as raw bytes.

src/fs/read_to_string.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
use std::path::Path;
2-
31
use crate::io;
2+
use crate::path::Path;
43
use crate::task::blocking;
54

65
/// Reads the entire contents of a file as a string.

0 commit comments

Comments
 (0)