Skip to content

Commit 78ba0b8

Browse files
authored
Merge pull request #625 from spk/fix-warning-unused-import
Remove unused imports on fs/file.rs
2 parents db8c6e4 + bd655f9 commit 78ba0b8

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/fs/file.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
//! Files, and methods and fields to access their metadata.
22
3-
use std::fs::{self, metadata};
43
use std::io::Error as IOError;
54
use std::io::Result as IOResult;
65
use std::os::unix::fs::{MetadataExt, PermissionsExt, FileTypeExt};
76
use std::path::{Path, PathBuf};
8-
use std::time::{SystemTime, UNIX_EPOCH, Duration};
7+
use std::time::{UNIX_EPOCH, Duration};
98

109
use log::{debug, error};
1110

1211
use crate::fs::dir::Dir;
1312
use crate::fs::fields as f;
14-
use crate::options::Misfire;
15-
1613

1714
/// A **File** is a wrapper around one of Rust's Path objects, along with
1815
/// associated data about the file.
@@ -48,7 +45,7 @@ pub struct File<'dir> {
4845
/// This too is queried multiple times, and is *not* cached by the OS, as
4946
/// it could easily change between invocations — but exa is so short-lived
5047
/// it's better to just cache it.
51-
pub metadata: fs::Metadata,
48+
pub metadata: std::fs::Metadata,
5249

5350
/// A reference to the directory that contains this file, if any.
5451
///
@@ -78,7 +75,7 @@ impl<'dir> File<'dir> {
7875
let ext = File::ext(&path);
7976

8077
debug!("Statting file {:?}", &path);
81-
let metadata = fs::symlink_metadata(&path)?;
78+
let metadata = std::fs::symlink_metadata(&path)?;
8279
let is_all_all = false;
8380

8481
Ok(File { path, parent_dir, metadata, ext, name, is_all_all })
@@ -89,7 +86,7 @@ impl<'dir> File<'dir> {
8986
let ext = File::ext(&path);
9087

9188
debug!("Statting file {:?}", &path);
92-
let metadata = fs::symlink_metadata(&path)?;
89+
let metadata = std::fs::symlink_metadata(&path)?;
9390
let is_all_all = true;
9491

9592
Ok(File { path, parent_dir: Some(parent_dir), metadata, ext, name: ".".to_string(), is_all_all })
@@ -99,7 +96,7 @@ impl<'dir> File<'dir> {
9996
let ext = File::ext(&path);
10097

10198
debug!("Statting file {:?}", &path);
102-
let metadata = fs::symlink_metadata(&path)?;
99+
let metadata = std::fs::symlink_metadata(&path)?;
103100
let is_all_all = true;
104101

105102
Ok(File { path, parent_dir: Some(parent_dir), metadata, ext, name: "..".to_string(), is_all_all })
@@ -239,7 +236,7 @@ impl<'dir> File<'dir> {
239236
// we actually look up and turn into a `File` — which needs to be
240237
// absolute to be accessible from any directory.
241238
debug!("Reading link {:?}", &self.path);
242-
let path = match fs::read_link(&self.path) {
239+
let path = match std::fs::read_link(&self.path) {
243240
Ok(p) => p,
244241
Err(e) => return FileTarget::Err(e),
245242
};
@@ -248,7 +245,7 @@ impl<'dir> File<'dir> {
248245

249246
// Use plain `metadata` instead of `symlink_metadata` - we *want* to
250247
// follow links.
251-
match fs::metadata(&absolute_path) {
248+
match std::fs::metadata(&absolute_path) {
252249
Ok(metadata) => {
253250
let ext = File::ext(&path);
254251
let name = File::filename(&path);

0 commit comments

Comments
 (0)