Skip to content

Commit 7d3dafe

Browse files
committed
Fixed crate_universe clippy defects
1 parent 41b39f0 commit 7d3dafe

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

crate_universe/src/context/crate_context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,9 +564,9 @@ impl CrateContext {
564564

565565
// Locate the crate's root source file relative to the package root normalized for unix
566566
let crate_root =
567-
pathdiff::diff_paths(target.src_path.to_string(), package_root).map(
567+
pathdiff::diff_paths(&target.src_path, package_root).map(
568568
// Normalize the path so that it always renders the same regardless of platform
569-
|root| root.to_string_lossy().replace("\\", "/"),
569+
|root| root.to_string_lossy().replace('\\', "/"),
570570
);
571571

572572
// Conditionally check to see if the dependencies is a build-script target

crate_universe/src/splicing/splicer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ impl<'a> SplicerKind<'a> {
9696
!manifests.keys().any(|path| {
9797
let path_str = path.to_string_lossy().to_string();
9898
// Account for windows paths.
99-
let path_str = path_str.replace("\\", "/");
99+
let path_str = path_str.replace('\\', "/");
100100
// Workspace members are represented as directories.
101101
path_str.trim_end_matches("/Cargo.toml").ends_with(member)
102102
})
@@ -1015,7 +1015,7 @@ mod test {
10151015
// On windows, make sure we normalize the path to match what Cargo would
10161016
// otherwise use to populate metadata.
10171017
if cfg!(target_os = "windows") {
1018-
workspace_root = format!("/{}", workspace_root.replace("\\", "/"))
1018+
workspace_root = format!("/{}", workspace_root.replace('\\', "/"))
10191019
};
10201020

10211021
if is_root {

0 commit comments

Comments
 (0)