Skip to content

Commit

Permalink
Merge branch 'main' into update-working-dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Canop committed Dec 30, 2023
2 parents 4c40273 + eb2af6c commit c30ee02
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
10 changes: 6 additions & 4 deletions compile-all-targets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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' ]]
Expand All @@ -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" ""
Expand All @@ -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/
Expand Down Expand Up @@ -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}"

4 changes: 2 additions & 2 deletions src/help/help_verbs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
_ => " ",
})
Expand Down Expand Up @@ -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, "**", "**")
Expand Down
2 changes: 1 addition & 1 deletion src/pattern/pattern_parts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion src/verb/verb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/verb/verb_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ impl VerbStore {
) -> Option<String> {
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
Expand All @@ -568,7 +568,7 @@ impl VerbStore {
) -> Option<String> {
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
Expand Down

0 comments on commit c30ee02

Please sign in to comment.