From c1e36454cd4f5c36260e5ee77c4d6582f8383b1b Mon Sep 17 00:00:00 2001 From: Canop Date: Fri, 29 Dec 2023 18:35:14 +0100 Subject: [PATCH 1/2] quieter compile script --- compile-all-targets.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/compile-all-targets.sh b/compile-all-targets.sh index e56b9cb7..17fcf8e6 100755 --- a/compile-all-targets.sh +++ b/compile-all-targets.sh @@ -25,12 +25,12 @@ cross_build() { target="$2" features="$3" echo -e "${H2}Compiling the $target_name version (target=$target, features='$features')${EH}" - cargo clean + cargo clean --quiet if [[ -n $features ]] then - cross build --target "$target" --release --features "$features" + cross build --quiet --target "$target" --release --features "$features" else - cross build --target "$target" --release + cross build --quiet --target "$target" --release fi mkdir "build/$target" if [[ $target_name == 'Windows' ]] @@ -40,6 +40,7 @@ cross_build() { exec="$NAME" fi cp "target/$target/release/$exec" "build/$target/" + echo " Done" } cross_build "x86-64 GLIBC" "x86_64-unknown-linux-gnu" "" @@ -56,7 +57,7 @@ cross_build "Windows" "x86_64-pc-windows-gnu" "clipboard" # Build the default linux version (with clipboard support, needing a recent GLIBC) # recent glibc echo -e "${H2}Compiling the standard linux version${EH}" -cargo build --release --features "clipboard" +cargo build --quiet --release --features "clipboard" strip "target/release/$NAME" mkdir build/x86_64-linux/ cp "target/release/$NAME" build/x86_64-linux/ @@ -88,3 +89,4 @@ For more information, or if you prefer to compile yourself, see https://dystroy. ' > build/install.md echo -e "${H1}FINISHED${EH}" + From eb2af6c65ebb77da7b50ef0971c2f64ae7d942e2 Mon Sep 17 00:00:00 2001 From: Canop Date: Fri, 29 Dec 2023 18:38:29 +0100 Subject: [PATCH 2/2] some clippy lints are just painful --- src/display/luma.rs | 1 - src/help/help_verbs.rs | 4 ++-- src/pattern/pattern_parts.rs | 2 +- src/verb/verb.rs | 2 +- src/verb/verb_store.rs | 4 ++-- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/display/luma.rs b/src/display/luma.rs index 69d7b923..4ca69898 100644 --- a/src/display/luma.rs +++ b/src/display/luma.rs @@ -1,5 +1,4 @@ pub use { - crate::cli::{Args, TriBool}, crokey::crossterm::tty::IsTty, once_cell::sync::Lazy, serde::Deserialize, diff --git a/src/help/help_verbs.rs b/src/help/help_verbs.rs index f0d3e78f..795f9f3d 100644 --- a/src/help/help_verbs.rs +++ b/src/help/help_verbs.rs @@ -23,7 +23,7 @@ impl MatchingVerbRow<'_> { // there should be a better way to write this self.name .as_deref() - .unwrap_or_else(|| match self.verb.names.get(0) { + .unwrap_or_else(|| match self.verb.names.first() { Some(s) => s.as_str(), _ => " ", }) @@ -54,7 +54,7 @@ pub fn matching_verb_rows<'v>( let mut shortcut = None; if pat.is_some() { let mut ok = false; - name = verb.names.get(0).and_then(|s| { + name = verb.names.first().and_then(|s| { pat.search_string(s).map(|nm| { ok = true; nm.wrap(s, "**", "**") diff --git a/src/pattern/pattern_parts.rs b/src/pattern/pattern_parts.rs index 309f9b68..a06a13ac 100644 --- a/src/pattern/pattern_parts.rs +++ b/src/pattern/pattern_parts.rs @@ -63,7 +63,7 @@ impl PatternParts { } pub fn mode(&self) -> Option<&String> { if self.parts.len() > 1 { - self.parts.get(0) + self.parts.first() } else { None } diff --git a/src/verb/verb.rs b/src/verb/verb.rs index fe3ae12e..332649d5 100644 --- a/src/verb/verb.rs +++ b/src/verb/verb.rs @@ -219,7 +219,7 @@ impl Verb { app_state: &AppState, invocation: &VerbInvocation, ) -> String { - let name = self.names.get(0).unwrap_or(&invocation.name); + let name = self.names.first().unwrap_or(&invocation.name); // there's one special case: the ̀ :focus` internal. As long // as no other internal takes args, and no other verb can diff --git a/src/verb/verb_store.rs b/src/verb/verb_store.rs index 0229a34a..43b6c5ce 100644 --- a/src/verb/verb_store.rs +++ b/src/verb/verb_store.rs @@ -556,7 +556,7 @@ impl VerbStore { ) -> Option { for verb in &self.verbs { if verb.get_internal() == Some(internal) && verb.selection_condition.accepts_selection_type(stype) { - return verb.keys.get(0).map(|&k| KEY_FORMAT.to_string(k)); + return verb.keys.first().map(|&k| KEY_FORMAT.to_string(k)); } } None @@ -568,7 +568,7 @@ impl VerbStore { ) -> Option { for verb in &self.verbs { if verb.get_internal() == Some(internal) { - return verb.keys.get(0).map(|&k| KEY_FORMAT.to_string(k)); + return verb.keys.first().map(|&k| KEY_FORMAT.to_string(k)); } } None