Skip to content

Commit bf52f0a

Browse files
karthiknadigCopilot
andcommitted
chore: remove needless borrows in pet-hatch tests (Fixes #481)
PathBuf already implements the traits required by norm_case, so the extra & borrows tripped clippy's needless_borrows_for_generic_args lint under newer clippy versions, breaking the documented cargo clippy --all -- -D warnings pre-commit gate. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 89bf1c0 commit bf52f0a

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎crates/pet-hatch/src/lib.rs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1311,7 +1311,7 @@ mod tests {
13111311
};
13121312
locator.configure(&config);
13131313
let first = locator.workspace_entry(&project);
1314-
assert_eq!(first.virtual_dirs, vec![norm_case(&project.join(".hatch"))]);
1314+
assert_eq!(first.virtual_dirs, vec![norm_case(project.join(".hatch"))]);
13151315

13161316
// Edit the TOML and re-configure; the cache should drop the old
13171317
// parse and the next access should reflect the new path.
@@ -1326,7 +1326,7 @@ mod tests {
13261326
"configure() must invalidate the parsed cache"
13271327
);
13281328
let second = locator.workspace_entry(&project);
1329-
assert_eq!(second.virtual_dirs, vec![norm_case(&project.join(".envs"))]);
1329+
assert_eq!(second.virtual_dirs, vec![norm_case(project.join(".envs"))]);
13301330
}
13311331

13321332
#[test]
@@ -1459,7 +1459,7 @@ mod tests {
14591459
let entry = locator.workspace_entry(&project);
14601460
assert_eq!(
14611461
entry.virtual_dirs,
1462-
vec![norm_case(&project.join(".hatch-final"))],
1462+
vec![norm_case(project.join(".hatch-final"))],
14631463
"post-configure workspace_entry must reflect on-disk state, not a leaked stale parse"
14641464
);
14651465
}
@@ -1500,7 +1500,7 @@ mod tests {
15001500
// for it must still return a parsed entry (the in-flight caller
15011501
// needs a usable value) but must not pollute the cache.
15021502
let entry = locator.workspace_entry(&removed);
1503-
assert_eq!(entry.virtual_dirs, vec![norm_case(&removed.join(".hatch"))]);
1503+
assert_eq!(entry.virtual_dirs, vec![norm_case(removed.join(".hatch"))]);
15041504
let state = locator.state.lock().unwrap();
15051505
assert!(
15061506
!state.parsed.contains_key(&removed),

0 commit comments

Comments
 (0)