aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crates/atuin/src/command/client/search.rs25
1 files changed, 11 insertions, 14 deletions
diff --git a/crates/atuin/src/command/client/search.rs b/crates/atuin/src/command/client/search.rs
index be00ee99..ceeb9436 100644
--- a/crates/atuin/src/command/client/search.rs
+++ b/crates/atuin/src/command/client/search.rs
@@ -150,20 +150,17 @@ impl Cmd {
store: SqliteStore,
theme: &Theme,
) -> Result<()> {
- let query = self.query.map_or_else(
- || {
- std::env::var("ATUIN_QUERY").map_or_else(
- |_| vec![],
- |query| {
- query
- .split(' ')
- .map(std::string::ToString::to_string)
- .collect()
- },
- )
- },
- |query| query,
- );
+ let query = self.query.unwrap_or_else(|| {
+ std::env::var("ATUIN_QUERY").map_or_else(
+ |_| vec![],
+ |query| {
+ query
+ .split(' ')
+ .map(std::string::ToString::to_string)
+ .collect()
+ },
+ )
+ });
if (self.delete_it_all || self.delete) && self.limit.is_some() {
// Because of how deletion is implemented, it will always delete all matches