From e9d0af03431bdb6a02edcb6ac4ab09e968073c90 Mon Sep 17 00:00:00 2001 From: Chester Liu Date: Fri, 26 Mar 2021 16:53:31 +0800 Subject: [PATCH] Restore more --- src/fs/file.rs | 4 +++- src/fs/filter.rs | 1 + src/options/parser.rs | 2 +- src/output/table.rs | 3 ++- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/fs/file.rs b/src/fs/file.rs index 2ef3ff4..9882d05 100644 --- a/src/fs/file.rs +++ b/src/fs/file.rs @@ -20,6 +20,7 @@ use crate::fs::fields as f; /// information queried at least once, so it makes sense to do all this at the /// start and hold on to all the information. pub struct File<'dir> { + /// The filename portion of this file’s path, including the extension. /// /// This is used to compare against certain filenames (such as checking if @@ -75,7 +76,7 @@ impl<'dir> File<'dir> { let ext = File::ext(&path); debug!("Statting file {:?}", &path); - let metadata = std::fs::symlink_metadata(&path)?; + let metadata = std::fs::symlink_metadata(&path)?; let is_all_all = false; Ok(File { path, parent_dir, metadata, ext, name, is_all_all }) @@ -209,6 +210,7 @@ impl<'dir> File<'dir> { self.metadata.file_type().is_socket() } + /// Re-prefixes the path pointed to by this file, if it’s a symlink, to /// make it an absolute path that can be accessed from whichever /// directory exa is being run from. diff --git a/src/fs/filter.rs b/src/fs/filter.rs index ea99700..f266094 100644 --- a/src/fs/filter.rs +++ b/src/fs/filter.rs @@ -380,6 +380,7 @@ pub enum GitIgnore { // > .gitignore, .git/info/exclude and even your global gitignore globs, // > usually found in $XDG_CONFIG_HOME/git/ignore. + #[cfg(test)] mod test_ignores { use super::*; diff --git a/src/options/parser.rs b/src/options/parser.rs index 34a7ef8..f43d44e 100644 --- a/src/options/parser.rs +++ b/src/options/parser.rs @@ -724,4 +724,4 @@ mod matches_test { assert_eq!(flags.has(&COUNT).unwrap(), false); } -} \ No newline at end of file +} diff --git a/src/output/table.rs b/src/output/table.rs index aa1ed1c..d990273 100644 --- a/src/output/table.rs +++ b/src/output/table.rs @@ -31,6 +31,7 @@ pub struct Options { /// Extra columns to display in the table. #[derive(PartialEq, Debug, Copy, Clone)] pub struct Columns { + /// At least one of these timestamps will be shown. pub time_types: TimeTypes, @@ -49,7 +50,6 @@ pub struct Columns { } impl Columns { - pub fn collect(&self, actually_enable_git: bool) -> Vec { let mut columns = Vec::with_capacity(4); @@ -253,6 +253,7 @@ impl TimeType { } } + /// Fields for which of a file’s time fields should be displayed in the /// columns output. ///