Skip to content

Commit d51e84f

Browse files
committed
Appease clippy
Various fixups to satisfy clippy.
1 parent 700d900 commit d51e84f

File tree

8 files changed

+11
-9
lines changed

8 files changed

+11
-9
lines changed

cargo-dist/src/backend/installer/macpkg.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ impl PkgInstallerInfo {
5252
info!("Copying executables");
5353
for exe in &self.artifact.executables {
5454
info!("{} => {:?}", &self.package_dir.join(exe), bindir.join(exe));
55-
LocalAsset::copy_file_to_file(&self.package_dir.join(exe), bindir.join(exe))?;
55+
LocalAsset::copy_file_to_file(self.package_dir.join(exe), bindir.join(exe))?;
5656
}
5757
#[cfg(unix)]
5858
for (bin, targets) in &self.bin_aliases {
5959
for target in targets {
60-
std::os::unix::fs::symlink(&bindir.join(bin), &bindir.join(target))?;
60+
std::os::unix::fs::symlink(bindir.join(bin), bindir.join(target))?;
6161
}
6262
}
6363
for lib in self
@@ -66,7 +66,7 @@ impl PkgInstallerInfo {
6666
.iter()
6767
.chain(self.artifact.cstaticlibs.iter())
6868
{
69-
LocalAsset::copy_file_to_file(&self.package_dir.join(lib), libdir.join(lib))?;
69+
LocalAsset::copy_file_to_file(self.package_dir.join(lib), libdir.join(lib))?;
7070
}
7171

7272
// The path the two pkg files get placed in while building

cargo-dist/src/env.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ fn formulas_from_env(environment: &SortedMap<&str, &str>) -> Vec<(String, String
8686
for dep in formulastring.split(',') {
8787
// Unwrap here is safe because `split` will always return
8888
// a collection of at least one item.
89-
let short_name = dep.split('/').last().unwrap();
89+
let short_name = dep.split('/').next_back().unwrap();
9090
let pkg_opt = format!("{opt_prefix}/{short_name}");
9191
packages.push((dep.to_owned(), pkg_opt));
9292
}

cargo-dist/src/linkage.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ fn determine_linux_build_environment() -> DistResult<BuildEnvironment> {
482482
// ldd (GNU libc) 2.39 (Fedora)
483483
first_line
484484
.split(' ')
485-
.last()
485+
.next_back()
486486
.and_then(|s| s.split_once('.').map(glibc_from_tuple))
487487
.transpose()?
488488
};

cargo-dist/src/migrate/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ fn do_migrate_from_dist_toml() -> DistResult<()> {
148148
// Try to keep existing comments if we can
149149
if let Some(desc) = decor.prefix().and_then(|p| p.as_str()) {
150150
if !desc.starts_with('\n') {
151-
decor.set_prefix(&format!("\n{desc}"));
151+
decor.set_prefix(format!("\n{desc}"));
152152
}
153153
} else {
154154
decor.set_prefix("\n");

cargo-dist/src/sign/macos.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
//! 2) Apple expects certificates to be located in the Keychain,
66
//! a Mac-specific certificate store, which interacts a bit
77
//! weirdly with our ephemeral runner setup in CI.
8+
//!
89
//! Most of this module is actually concerned with ephemeral
910
//! keychain setup, with the signing section of the code relatively
1011
//! short in comparison. The keychain code will be reused elsewhere

vendor/axoasset/examples/compress.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ fn main() {
2828
doit(args).unwrap()
2929
}
3030

31+
#[allow(clippy::result_large_err)]
3132
fn doit(args: Cli) -> Result<(), AxoassetError> {
3233
#[cfg(feature = "compression-tar")]
3334
if args.dest_path.as_str().ends_with("tar.zstd") {

vendor/axoasset/tests/source.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ goodbye = true
174174
// Get the span for a non-substring (string literal isn't pointing into the String)
175175
let val = source.deserialize_toml_edit().unwrap();
176176
assert_eq!(val["hello"].as_str().unwrap(), "there");
177-
assert_eq!(val["goodbye"].as_bool().unwrap(), true);
177+
assert!(val["goodbye"].as_bool().unwrap());
178178
}
179179

180180
#[cfg(feature = "toml-edit")]
@@ -219,7 +219,7 @@ goodbye: true
219219

220220
let res = source.deserialize_yaml::<MyType>().unwrap();
221221
assert_eq!(res.hello, "there");
222-
assert_eq!(res.goodbye, true);
222+
assert!(res.goodbye);
223223
}
224224

225225
#[test]

vendor/axocli/examples/axoapp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fn run(app: &axocli::CliApp<CliArgs>) -> Result<(), Report> {
4040
"i have no exclamation marks but i must scream"
4141
);
4242
if app.config.exclaim_count < 3 {
43-
return Err(AxoAppError::NotExcitedEnough)?;
43+
Err(AxoAppError::NotExcitedEnough)?;
4444
}
4545
let message = "hello axoapp";
4646

0 commit comments

Comments
 (0)