Quellcode durchsuchen

on second thought: renaming the vars but keeping them makes more sense

Rust optimizes them away anyways (basic test on godbolt does confirm)
sbatial vor 2 Jahren
Ursprung
Commit
02189ea322
1 geänderte Dateien mit 4 neuen und 1 gelöschten Zeilen
  1. 4 1
      src/options/filter.rs

+ 4 - 1
src/options/filter.rs

@@ -160,7 +160,10 @@ impl DotFilter {
     /// `--almost-all` binds stronger than multiple `--all` as we currently do not take the order
     /// of arguments into account and it is the safer option (does not clash with `--tree`)
     pub fn deduce(matches: &MatchedFlags<'_>) -> Result<Self, OptionsError> {
-        match (matches.count(&flags::ALL), matches.has(&flags::ALMOST_ALL)?) {
+        let all_count = matches.count(&flags::ALL);
+        let has_almost_all = matches.has(&flags::ALMOST_ALL)?;
+
+        match (all_count, has_almost_all) {
             (0, false) => Ok(Self::JustFiles),
 
             // either a single --all or at least one --almost-all is given