Просмотр исходного кода

refactor: rename Blocks column to Blocksize

Rename Blocks column to Blocksize
Sandro-Alessio Gierens 2 лет назад
Родитель
Сommit
c67ad6770a
2 измененных файлов с 9 добавлено и 9 удалено
  1. 2 2
      src/options/view.rs
  2. 7 7
      src/output/table.rs

+ 2 - 2
src/options/view.rs

@@ -223,7 +223,7 @@ impl Columns {
         let subdir_git_repos = matches.has(&flags::GIT_REPOS)?;
         let subdir_git_repos = matches.has(&flags::GIT_REPOS)?;
         let subdir_git_repos_no_stat = !subdir_git_repos && matches.has(&flags::GIT_REPOS_NO_STAT)?;
         let subdir_git_repos_no_stat = !subdir_git_repos && matches.has(&flags::GIT_REPOS_NO_STAT)?;
 
 
-        let blocks           = matches.has(&flags::BLOCKS)?;
+        let blocksize        = matches.has(&flags::BLOCKS)?;
         let group            = matches.has(&flags::GROUP)?;
         let group            = matches.has(&flags::GROUP)?;
         let inode            = matches.has(&flags::INODE)?;
         let inode            = matches.has(&flags::INODE)?;
         let links            = matches.has(&flags::LINKS)?;
         let links            = matches.has(&flags::LINKS)?;
@@ -234,7 +234,7 @@ impl Columns {
         let filesize =    ! matches.has(&flags::NO_FILESIZE)?;
         let filesize =    ! matches.has(&flags::NO_FILESIZE)?;
         let user =        ! matches.has(&flags::NO_USER)?;
         let user =        ! matches.has(&flags::NO_USER)?;
 
 
-        Ok(Self { time_types, inode, links, blocks, group, git, subdir_git_repos, subdir_git_repos_no_stat, octal, security_context, permissions, filesize, user })
+        Ok(Self { time_types, inode, links, blocksize, group, git, subdir_git_repos, subdir_git_repos_no_stat, octal, security_context, permissions, filesize, user })
     }
     }
 }
 }
 
 

+ 7 - 7
src/output/table.rs

@@ -48,7 +48,7 @@ pub struct Columns {
     // The rest are just on/off
     // The rest are just on/off
     pub inode: bool,
     pub inode: bool,
     pub links: bool,
     pub links: bool,
-    pub blocks: bool,
+    pub blocksize: bool,
     pub group: bool,
     pub group: bool,
     pub git: bool,
     pub git: bool,
     pub subdir_git_repos: bool,
     pub subdir_git_repos: bool,
@@ -89,9 +89,9 @@ impl Columns {
             columns.push(Column::FileSize);
             columns.push(Column::FileSize);
         }
         }
 
 
-        if self.blocks {
+        if self.blocksize {
             #[cfg(unix)]
             #[cfg(unix)]
-            columns.push(Column::Blocks);
+            columns.push(Column::Blocksize);
         }
         }
 
 
         if self.user {
         if self.user {
@@ -148,7 +148,7 @@ pub enum Column {
     FileSize,
     FileSize,
     Timestamp(TimeType),
     Timestamp(TimeType),
     #[cfg(unix)]
     #[cfg(unix)]
-    Blocks,
+    Blocksize,
     #[cfg(unix)]
     #[cfg(unix)]
     User,
     User,
     #[cfg(unix)]
     #[cfg(unix)]
@@ -184,7 +184,7 @@ impl Column {
             Self::FileSize   |
             Self::FileSize   |
             Self::HardLinks  |
             Self::HardLinks  |
             Self::Inode      |
             Self::Inode      |
-            Self::Blocks     |
+            Self::Blocksize  |
             Self::GitStatus  => Alignment::Right,
             Self::GitStatus  => Alignment::Right,
             Self::Timestamp(_) | 
             Self::Timestamp(_) | 
             _                => Alignment::Left,
             _                => Alignment::Left,
@@ -211,7 +211,7 @@ impl Column {
             Self::FileSize      => "Size",
             Self::FileSize      => "Size",
             Self::Timestamp(t)  => t.header(),
             Self::Timestamp(t)  => t.header(),
             #[cfg(unix)]
             #[cfg(unix)]
-            Self::Blocks        => "Blocks",
+            Self::Blocksize     => "Blocksize",
             #[cfg(unix)]
             #[cfg(unix)]
             Self::User          => "User",
             Self::User          => "User",
             #[cfg(unix)]
             #[cfg(unix)]
@@ -515,7 +515,7 @@ impl<'a> Table<'a> {
                 file.inode().render(self.theme.ui.inode)
                 file.inode().render(self.theme.ui.inode)
             }
             }
             #[cfg(unix)]
             #[cfg(unix)]
-            Column::Blocks => {
+            Column::Blocksize => {
                 file.blocksize().render(self.theme, self.size_format, &self.env.numeric)
                 file.blocksize().render(self.theme, self.size_format, &self.env.numeric)
             }
             }
             #[cfg(unix)]
             #[cfg(unix)]