Skip to content
This repository was archived by the owner on May 18, 2026. It is now read-only.
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
4 changes: 2 additions & 2 deletions lib/src/actions/binary/github.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl Action for BinaryGitHub {
let async_runtime = match Runtime::new() {
Ok(runtime) => runtime,
Err(e) => {
return Err(anyhow!("Failed to create async runtime: {}", e));
return Err(anyhow!("Failed to create async runtime: {e}"));
}
};

Expand All @@ -66,7 +66,7 @@ impl Action for BinaryGitHub {
let release = match result {
Ok(release) => release,
Err(e) => {
return Err(anyhow!("Failed to find a release: {}", e));
return Err(anyhow!("Failed to find a release: {e}"));
}
};

Expand Down
11 changes: 3 additions & 8 deletions lib/src/actions/file/copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,12 @@ impl Action for FileCopy {
Err(err) => match err.source() {
Some(source) => {
return Err(anyhow!(
"Failed to render contents for FileCopy action: {}",
source
"Failed to render contents for FileCopy action: {source}"
));
}
None => {
return Err(anyhow!(
"Failed to render contents for FileCopy action: {}",
err
"Failed to render contents for FileCopy action: {err}"
));
}
},
Expand All @@ -87,10 +85,7 @@ impl Action for FileCopy {
}
}
Err(err) => {
return Err(anyhow!(
"Failed to get contents for FileCopy action: {}",
err
));
return Err(anyhow!("Failed to get contents for FileCopy action: {err}"));
}
};

Expand Down
2 changes: 1 addition & 1 deletion lib/src/actions/file/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub trait FileAction: Action {
"Failed because {} was not found",
file_path.to_string_lossy()
),
_ => anyhow!("Failed because {}", e),
_ => anyhow!("Failed because {e}"),
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/actions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ where
match engine.eval_with_scope::<bool>(&mut scope, condition.as_str()) {
Ok(true) => self.action.plan(manifest, context),
Ok(false) => Ok(vec![]),
Err(error) => Err(anyhow!("Failed execution condition for action: {}", error)),
Err(error) => Err(anyhow!("Failed execution condition for action: {error}")),
}
}
}
Expand Down
5 changes: 2 additions & 3 deletions lib/src/atoms/command/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ impl Exec {
)),

Err(err) => Err(anyhow!(
"Command requires privilege escalation, but couldn't elevate privileges: {}",
err
"Command requires privilege escalation, but couldn't elevate privileges: {err}"
)),
}
}
Expand Down Expand Up @@ -115,7 +114,7 @@ impl Atom for Exec {
let (command, arguments) = self.elevate_if_required();

let command = utilities::get_binary_path(&command)
.map_err(|_| anyhow!("Command `{}` not found in path", command))?;
.map_err(|_| anyhow!("Command `{command}` not found in path"))?;

// If we require root, we need to use sudo with inherited IO
// to ensure the user can respond if prompted for a password
Expand Down
4 changes: 2 additions & 2 deletions lib/src/atoms/plugin/globals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ fn add_context(lua: &Lua, contexts: Contexts, globals: &Table) -> Result<()> {
.map(|json| json_to_lua(&json, lua).map_err(Error::from))
{
Ok(Ok(lua_val)) => inner_table.set(k, lua_val)?,
Ok(Err(e)) => Err(anyhow!("Converting {}: {} to Lua {}", &key, k, e))?,
Err(e) => Err(anyhow!("Converting {} to Lua {}", k, e))?,
Ok(Err(e)) => Err(anyhow!("Converting {key}: {k} to Lua {e}"))?,
Err(e) => Err(anyhow!("Converting {k} to Lua {e}"))?,
}
}

Expand Down
9 changes: 3 additions & 6 deletions lib/src/values/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,7 @@ impl TryFrom<JsonValue> for Value {
Some(n) => n.into(),
None => {
return Err(anyhow::anyhow!(
"Failed converting number {:?} to json.",
number
"Failed converting number {number:?} to json."
))
}
}
Expand All @@ -374,8 +373,7 @@ impl TryFrom<JsonValue> for Value {
Some(n) => n.into(),
None => {
return Err(anyhow::anyhow!(
"Failed converting number {:?} to json.",
number
"Failed converting number {number:?} to json."
))
}
}
Expand All @@ -384,8 +382,7 @@ impl TryFrom<JsonValue> for Value {
Some(n) => n.into(),
None => {
return Err(anyhow::anyhow!(
"Failed converting number {:?} to json.",
number
"Failed converting number {number:?} to json."
))
}
}
Expand Down