Skip to content

Commit 8ab6b93

Browse files
committed
chore: Fix clippy warnings
1 parent b213bb7 commit 8ab6b93

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

cli/src/lib.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,7 @@ fn init(
10511051
.stdout(Stdio::inherit())
10521052
.stderr(Stdio::inherit())
10531053
.output()
1054-
.map_err(|e| anyhow::format_err!("git init failed: {}", e.to_string()))?;
1054+
.map_err(|e| anyhow::format_err!("git init failed: {}", e))?;
10551055
if !git_result.status.success() {
10561056
eprintln!("Failed to automatically initialize a new git repository");
10571057
}
@@ -1069,14 +1069,14 @@ fn install_node_modules(cmd: &str) -> Result<std::process::Output> {
10691069
.stdout(Stdio::inherit())
10701070
.stderr(Stdio::inherit())
10711071
.output()
1072-
.map_err(|e| anyhow::format_err!("{} install failed: {}", cmd, e.to_string()))
1072+
.map_err(|e| anyhow::format_err!("{} install failed: {}", cmd, e))
10731073
} else {
10741074
std::process::Command::new(cmd)
10751075
.arg("install")
10761076
.stdout(Stdio::inherit())
10771077
.stderr(Stdio::inherit())
10781078
.output()
1079-
.map_err(|e| anyhow::format_err!("{} install failed: {}", cmd, e.to_string()))
1079+
.map_err(|e| anyhow::format_err!("{} install failed: {}", cmd, e))
10801080
}
10811081
}
10821082

@@ -1262,7 +1262,7 @@ fn expand_program(
12621262
.args(cargo_args)
12631263
.stderr(Stdio::inherit())
12641264
.output()
1265-
.map_err(|e| anyhow::format_err!("{}", e.to_string()))?;
1265+
.map_err(|e| anyhow::format_err!("{}", e))?;
12661266
if !exit.status.success() {
12671267
eprintln!("'anchor expand' failed. Perhaps you have not installed 'cargo-expand'? https://github.com/dtolnay/cargo-expand#installation");
12681268
std::process::exit(exit.status.code().unwrap_or(1));
@@ -1271,7 +1271,7 @@ fn expand_program(
12711271
let version = cargo.version();
12721272
let time = chrono::Utc::now().to_string().replace(' ', "_");
12731273
let file_path = program_expansions_path.join(format!("{package_name}-{version}-{time}.rs"));
1274-
fs::write(&file_path, &exit.stdout).map_err(|e| anyhow::format_err!("{}", e.to_string()))?;
1274+
fs::write(&file_path, &exit.stdout).map_err(|e| anyhow::format_err!("{}", e))?;
12751275

12761276
println!(
12771277
"Expanded {} into file {}\n",
@@ -1612,7 +1612,7 @@ fn docker_build(
16121612
.stdout(Stdio::inherit())
16131613
.stderr(Stdio::inherit())
16141614
.output()
1615-
.map_err(|e| anyhow::format_err!("Docker build failed: {}", e.to_string()))?;
1615+
.map_err(|e| anyhow::format_err!("Docker build failed: {}", e))?;
16161616
if !exit.status.success() {
16171617
return Err(anyhow!("Failed to build program"));
16181618
}
@@ -1736,7 +1736,7 @@ fn docker_build_bpf(
17361736
Some(f) => f.into(),
17371737
})
17381738
.output()
1739-
.map_err(|e| anyhow::format_err!("Docker build failed: {}", e.to_string()))?;
1739+
.map_err(|e| anyhow::format_err!("Docker build failed: {}", e))?;
17401740
if !exit.status.success() {
17411741
return Err(anyhow!("Failed to build program"));
17421742
}
@@ -1768,7 +1768,7 @@ fn docker_build_bpf(
17681768
.stdout(Stdio::inherit())
17691769
.stderr(Stdio::inherit())
17701770
.output()
1771-
.map_err(|e| anyhow::format_err!("{}", e.to_string()))?;
1771+
.map_err(|e| anyhow::format_err!("{}", e))?;
17721772
if !exit.status.success() {
17731773
Err(anyhow!(
17741774
"Failed to copy binary out of docker. Is the target directory set correctly?"
@@ -1790,7 +1790,7 @@ fn docker_cleanup(container_name: &str, target_dir: &Path) -> Result<()> {
17901790
.stdout(Stdio::inherit())
17911791
.stderr(Stdio::inherit())
17921792
.output()
1793-
.map_err(|e| anyhow::format_err!("{}", e.to_string()))?;
1793+
.map_err(|e| anyhow::format_err!("{}", e))?;
17941794
if !exit.status.success() {
17951795
println!("Unable to remove the docker container");
17961796
std::process::exit(exit.status.code().unwrap_or(1));
@@ -1829,7 +1829,7 @@ fn _build_rust_cwd(
18291829
.stdout(Stdio::inherit())
18301830
.stderr(Stdio::inherit())
18311831
.output()
1832-
.map_err(|e| anyhow::format_err!("{}", e.to_string()))?;
1832+
.map_err(|e| anyhow::format_err!("{}", e))?;
18331833
if !exit.status.success() {
18341834
std::process::exit(exit.status.code().unwrap_or(1));
18351835
}
@@ -4094,7 +4094,7 @@ fn shell(cfg_override: &ConfigOverride) -> Result<()> {
40944094
.stdout(Stdio::inherit())
40954095
.stderr(Stdio::inherit())
40964096
.spawn()
4097-
.map_err(|e| anyhow::format_err!("{}", e.to_string()))?;
4097+
.map_err(|e| anyhow::format_err!("{}", e))?;
40984098

40994099
if !child.wait()?.success() {
41004100
println!("Error running node shell");
@@ -4340,7 +4340,7 @@ fn get_node_version() -> Result<Version> {
43404340
.arg("--version")
43414341
.stderr(Stdio::inherit())
43424342
.output()
4343-
.map_err(|e| anyhow::format_err!("node failed: {}", e.to_string()))?;
4343+
.map_err(|e| anyhow::format_err!("node failed: {}", e))?;
43444344
let output = std::str::from_utf8(&node_version.stdout)?
43454345
.strip_prefix('v')
43464346
.unwrap()

cli/src/rust_template.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ impl TestTemplate {
705705
.arg("tests")
706706
.stderr(Stdio::inherit())
707707
.output()
708-
.map_err(|e| anyhow::format_err!("{}", e.to_string()))?;
708+
.map_err(|e| anyhow::format_err!("{}", e))?;
709709
if !exit.status.success() {
710710
eprintln!("'cargo new --lib tests' failed");
711711
std::process::exit(exit.status.code().unwrap_or(1));

lang/syn/src/parser/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl CrateContext {
7777
ctx.file.canonicalize().unwrap().display(),
7878
span.start().line,
7979
span.start().column,
80-
ident.to_string()
80+
ident
8181
));
8282
};
8383
}

0 commit comments

Comments
 (0)