This commit is contained in:
sxyazi 2024-11-28 01:56:34 +08:00
parent a9fd9d13c6
commit a8ef6d6355
No known key found for this signature in database
3 changed files with 7 additions and 7 deletions

View file

@ -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,
})
}?;

View file

@ -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,
}
}

View file

@ -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::<RtRef>("rt") {