Skip to content

Commit

Permalink
Merge pull request #191 from qryxip/fix-clippy-lints
Browse files Browse the repository at this point in the history
Fix Clippy lints
  • Loading branch information
qryxip committed Apr 23, 2023
2 parents 0a7c6ab + 653ab04 commit 8f6b50b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ pub fn run(opt: Opt, ctx: Context<'_>) -> anyhow::Result<()> {

if let Some(output) = output {
let output = cwd.join(output);
cargo_util::paths::write(&output, code)
cargo_util::paths::write(output, code)
} else {
write!(shell.out(), "{}", code)?;
Ok(())
Expand Down
8 changes: 4 additions & 4 deletions src/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,19 +366,19 @@ impl<'opt> CodeEdit<'opt> {
} else if depth == 0 || src_path.file_name() == Some("mod.rs") {
vec![
src_path
.with_file_name(&ident.to_string())
.with_file_name(ident.to_string())
.with_extension("rs"),
src_path.with_file_name(&ident.to_string()).join("mod.rs"),
src_path.with_file_name(ident.to_string()).join("mod.rs"),
]
} else {
vec![
src_path
.with_extension("")
.with_file_name(&ident.to_string())
.with_file_name(ident.to_string())
.with_extension("rs"),
src_path
.with_extension("")
.with_file_name(&ident.to_string())
.with_file_name(ident.to_string())
.join("mod.rs"),
]
};
Expand Down
2 changes: 1 addition & 1 deletion src/toolchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub(crate) fn find_toolchain_compatible_with_ra(
.map(|s| s.split_whitespace().next().unwrap())
.flat_map(|toolchain| {
let version = toolchain.split('-').next().unwrap().parse().ok()?;
GEQ_1_48_0.matches(&version).then(|| (version, toolchain))
GEQ_1_48_0.matches(&version).then_some((version, toolchain))
})
.collect::<BTreeMap<Version, _>>();

Expand Down
8 changes: 4 additions & 4 deletions src/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ pub(crate) trait MetadataExt {
cargo_udeps_outcome: &HashSet<String>,
exclude: &[PkgSpec],
) -> anyhow::Result<BTreeMap<&'a cm::PackageId, (&'a cm::Target, String)>>;
fn dep_lib_by_extern_crate_name<'a>(
&'a self,
fn dep_lib_by_extern_crate_name(
&self,
package_id: &cm::PackageId,
extern_crate_name: &str,
) -> Option<&cm::Package>;
Expand Down Expand Up @@ -509,8 +509,8 @@ impl MetadataExt for cm::Metadata {
Ok(deps)
}

fn dep_lib_by_extern_crate_name<'a>(
&'a self,
fn dep_lib_by_extern_crate_name(
&self,
package_id: &cm::PackageId,
extern_crate_name: &str,
) -> Option<&cm::Package> {
Expand Down

0 comments on commit 8f6b50b

Please sign in to comment.