From a8ef6d635566abba5ed6e5f285c48c037a457c32 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Thu, 28 Nov 2024 01:56:34 +0800 Subject: [PATCH] .. --- yazi-core/src/tab/commands/search.rs | 8 ++++---- yazi-core/src/tab/commands/shell.rs | 2 +- yazi-fm/src/app/commands/plugin.rs | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/yazi-core/src/tab/commands/search.rs b/yazi-core/src/tab/commands/search.rs index 252bca25..6073147c 100644 --- a/yazi-core/src/tab/commands/search.rs +++ b/yazi-core/src/tab/commands/search.rs @@ -1,4 +1,4 @@ -use std::{mem, time::Duration}; +use std::{borrow::Cow, mem, time::Duration}; use tokio::pin; use tokio_stream::{StreamExt, wrappers::UnboundedReceiverStream}; @@ -29,7 +29,7 @@ impl Tab { InputProxy::show(InputCfg::search(&opt.via.to_string()).with_value(opt.subject)); if let Some(Ok(subject)) = input.recv().await { - opt.subject = subject.into(); + opt.subject = Cow::Owned(subject); TabProxy::search_do(opt); } }); @@ -52,14 +52,14 @@ impl Tab { external::rg(external::RgOpt { cwd: cwd.clone(), hidden, - subject: opt.subject.into(), + subject: opt.subject.into_owned(), args: opt.args, }) } else { external::fd(external::FdOpt { cwd: cwd.clone(), hidden, - subject: opt.subject.into(), + subject: opt.subject.into_owned(), args: opt.args, }) }?; diff --git a/yazi-core/src/tab/commands/shell.rs b/yazi-core/src/tab/commands/shell.rs index d3f892bf..5852da85 100644 --- a/yazi-core/src/tab/commands/shell.rs +++ b/yazi-core/src/tab/commands/shell.rs @@ -71,7 +71,7 @@ Please replace e.g. `shell` with `shell --interactive`, `shell "my-template"` wi let mut result = InputProxy::show(InputCfg::shell(opt.block).with_value(opt.run).with_cursor(opt.cursor)); match result.recv().await { - Some(Ok(e)) => opt.run = e.into(), + Some(Ok(e)) => opt.run = Cow::Owned(e), _ => return, } } diff --git a/yazi-fm/src/app/commands/plugin.rs b/yazi-fm/src/app/commands/plugin.rs index da97e660..2df1ebe2 100644 --- a/yazi-fm/src/app/commands/plugin.rs +++ b/yazi-fm/src/app/commands/plugin.rs @@ -23,7 +23,7 @@ impl App { } if opt.mode == PluginMode::Async { - return self.cx.tasks.plugin_micro(opt.id.as_ref().to_owned(), opt.args); + return self.cx.tasks.plugin_micro(opt.id.into_owned(), opt.args); } else if opt.mode == PluginMode::Sync && hits { return self.plugin_do(opt); } @@ -47,7 +47,7 @@ impl App { }; if opt.mode.auto_then(chunk.sync_entry) != PluginMode::Sync { - return self.cx.tasks.plugin_micro(opt.id.as_ref().to_owned(), opt.args); + return self.cx.tasks.plugin_micro(opt.id.into_owned(), opt.args); } match LUA.named_registry_value::("rt") {