Selaa lähdekoodia

It looks like you’re writing a letter

Benjamin Sago 8 vuotta sitten
vanhempi
sitoutus
205f18e848
3 muutettua tiedostoa jossa 10 lisäystä ja 11 poistoa
  1. 3 4
      src/fs/file.rs
  2. 6 6
      src/info/sources.rs
  3. 1 1
      src/options/mod.rs

+ 3 - 4
src/fs/file.rs

@@ -184,7 +184,7 @@ impl<'dir> File<'dir> {
             };
             let target_path = target_path_.as_ref().unwrap_or(&path);
             // Use plain `metadata` instead of `symlink_metadata` - we *want* to follow links.
-            (fs::metadata(&target_path), ext(&target_path))
+            (fs::metadata(&target_path), ext(target_path))
         };
 
         let filename = match path.components().next_back() {
@@ -418,9 +418,8 @@ impl<'dir> FileTarget<'dir> {
     /// gets used to determine how to highlight the link in grid views.
     pub fn is_broken(&self) -> bool {
         match *self {
-            FileTarget::Ok(_)      => false,
-            FileTarget::Broken(_)  => true,
-            FileTarget::Err(_)     => true,
+            FileTarget::Ok(_)                           => false,
+            FileTarget::Broken(_) | FileTarget::Err(_)  => true,
         }
     }
 }

+ 6 - 6
src/info/sources.rs

@@ -24,12 +24,12 @@ impl<'a> File<'a> {
                 "o"     => vec![self.path.with_extension("c"),      self.path.with_extension("cpp")], // C, C++
                 "pyc"   => vec![self.path.with_extension("py")],    // Python
 
-                "aux" => vec![self.path.with_extension("tex")],  // TeX: auxiliary file
-                "bbl" => vec![self.path.with_extension("tex")],  // BibTeX bibliography file
-                "blg" => vec![self.path.with_extension("tex")],  // BibTeX log file
-                "lof" => vec![self.path.with_extension("tex")],  // TeX list of figures
-                "log" => vec![self.path.with_extension("tex")],  // TeX log file
-                "lot" => vec![self.path.with_extension("tex")],  // TeX list of tables
+                "aux" |                                          // TeX: auxiliary file
+                "bbl" |                                          // BibTeX bibliography file
+                "blg" |                                          // BibTeX log file
+                "lof" |                                          // TeX list of figures
+                "log" |                                          // TeX log file
+                "lot" |                                          // TeX list of tables
                 "toc" => vec![self.path.with_extension("tex")],  // TeX table of contents
 
                 _ => vec![],  // No source files if none of the above

+ 1 - 1
src/options/mod.rs

@@ -130,7 +130,7 @@ impl Options {
     /// results will end up being displayed.
     pub fn should_scan_for_git(&self) -> bool {
         match self.view {
-            View::Details(Details { columns: Some(cols), .. }) => cols.should_scan_for_git(),
+            View::Details(Details { columns: Some(cols), .. }) |
             View::GridDetails(GridDetails { details: Details { columns: Some(cols), .. }, .. }) => cols.should_scan_for_git(),
             _ => false,
         }