Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/aqua/aqua_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ impl AquaPackage {
expr.run(program, &self.expr_ctx(v)).map_err(|e| eyre!(e))
}

fn expr_parser(&self, v: &str) -> expr::Environment {
fn expr_parser(&self, v: &str) -> expr::Environment<'_> {
let prefix = Regex::new(r"^[^0-9.]+").unwrap();
let ver = versions::Versioning::new(prefix.replace(v, ""));
let mut env = expr::Environment::new();
Expand Down
2 changes: 1 addition & 1 deletion src/aqua/aqua_template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ enum Token<'a> {
Pipe,
}

fn lex(code: &str) -> Result<Vec<Token>> {
fn lex(code: &str) -> Result<Vec<Token<'_>>> {
let mut tokens = vec![];
let mut code = code.trim();
while !code.is_empty() {
Expand Down
2 changes: 1 addition & 1 deletion src/cli/args/backend_arg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ impl Eq for BackendArg {}

impl PartialOrd for BackendArg {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
Some(self.short.cmp(&other.short))
Some(self.cmp(other))
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/cli/install_into.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl InstallInto {
let config = Config::get().await?;
let ts = Arc::new(
ToolsetBuilder::new()
.with_args(&[self.tool.clone()])
.with_args(std::slice::from_ref(&self.tool))
.build(&config)
.await?,
);
Expand Down
6 changes: 3 additions & 3 deletions src/cli/ls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ impl Ls {
table.truncate(true).print()
}

async fn get_prunable_runtime_list(&self, config: &Arc<Config>) -> Result<Vec<RuntimeRow>> {
async fn get_prunable_runtime_list(&self, config: &Arc<Config>) -> Result<Vec<RuntimeRow<'_>>> {
let installed_tool = self.installed_tool.clone().unwrap_or_default();
Ok(
prune::prunable_tools(config, installed_tool.iter().collect())
Expand All @@ -213,7 +213,7 @@ impl Ls {
.collect(),
)
}
async fn get_runtime_list(&self, config: &Arc<Config>) -> Result<Vec<RuntimeRow>> {
async fn get_runtime_list(&self, config: &Arc<Config>) -> Result<Vec<RuntimeRow<'_>>> {
let mut trs = config.get_tool_request_set().await?.clone();
if self.global {
trs = trs
Expand All @@ -238,7 +238,7 @@ impl Ls {
let mut ts = Toolset::from(trs);
ts.resolve(config).await?;

let rvs: Vec<RuntimeRow> = ts
let rvs: Vec<RuntimeRow<'_>> = ts
.list_all_versions(config)
.await?
.into_iter()
Expand Down
2 changes: 1 addition & 1 deletion src/cli/which.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl Which {
async fn get_toolset(&self, config: &Arc<Config>) -> Result<Toolset> {
let mut tsb = ToolsetBuilder::new();
if let Some(tool) = &self.tool {
tsb = tsb.with_args(&[tool.clone()]);
tsb = tsb.with_args(std::slice::from_ref(tool));
}
let ts = tsb.build(config).await?;
Ok(ts)
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/asdf_plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl AsdfPlugin {
}
}

fn repo(&self) -> MutexGuard<Git> {
fn repo(&self) -> MutexGuard<'_, Git> {
self.repo.lock().unwrap()
}

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/vfox_plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl VfoxPlugin {
}
}

fn repo(&self) -> MutexGuard<Git> {
fn repo(&self) -> MutexGuard<'_, Git> {
self.repo.lock().unwrap()
}

Expand Down
2 changes: 1 addition & 1 deletion src/shell/xonsh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::shell::{ActivateOptions, Shell};
#[derive(Default)]
pub struct Xonsh {}

fn xonsh_escape_sq(input: &str) -> Cow<str> {
fn xonsh_escape_sq(input: &str) -> Cow<'_, str> {
for (i, ch) in input.char_indices() {
if xonsh_escape_char(ch).is_some() {
let mut escaped_string = String::with_capacity(input.len());
Expand Down
2 changes: 1 addition & 1 deletion src/sysconfig/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub(super) struct SysconfigData(BTreeMap<String, Value>);

impl SysconfigData {
/// Returns an iterator over the key-value pairs in the map.
pub(super) fn iter_mut(&mut self) -> std::collections::btree_map::IterMut<String, Value> {
pub(super) fn iter_mut(&mut self) -> std::collections::btree_map::IterMut<'_, String, Value> {
self.0.iter_mut()
}

Expand Down
2 changes: 1 addition & 1 deletion src/task/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ impl TreeItem for (&Graph<Task, ()>, NodeIndex) {
Ok(())
}

fn children(&self) -> Cow<[Self::Child]> {
fn children(&self) -> Cow<'_, [Self::Child]> {
let v: Vec<_> = self.0.neighbors(self.1).map(|i| (self.0, i)).collect();
Cow::from(v)
}
Expand Down
2 changes: 1 addition & 1 deletion src/ui/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pub trait TreeItem: Clone {

fn write_self(&self) -> std::io::Result<()>;

fn children(&self) -> Cow<[Self::Child]>;
fn children(&self) -> Cow<'_, [Self::Child]>;
}

struct TreeItemIndentChars {
Expand Down
Loading