Skip to content

Commit a58af4f

Browse files
committed
Work around a couple of false positives for recent nightly clippy
This is likely rust-lang/rust-clippy#10577
1 parent 5a771c9 commit a58af4f

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

lib/src/default_index_store.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1943,6 +1943,9 @@ mod tests {
19431943
let id_1 = CommitId::from_hex("111111");
19441944
let change_id1 = new_change_id();
19451945
let id_2 = CommitId::from_hex("222222");
1946+
#[allow(clippy::redundant_clone)] // Work around nightly clippy false positive
1947+
// TODO: Remove the exception after https://github.com/rust-lang/rust-clippy/issues/10577
1948+
// is fixed or file a new bug.
19461949
let change_id2 = change_id1.clone();
19471950
index.add_commit_data(id_0.clone(), change_id0, &[]);
19481951
index.add_commit_data(id_1.clone(), change_id1.clone(), &[id_0.clone()]);

lib/src/repo_path.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -317,35 +317,35 @@ mod tests {
317317
fn parse_fs_path_wc_in_cwd() {
318318
let temp_dir = testutils::new_temp_dir();
319319
let cwd_path = temp_dir.path().join("repo");
320-
let wc_path = cwd_path.clone();
320+
let wc_path = &cwd_path;
321321

322322
assert_eq!(
323-
RepoPath::parse_fs_path(&cwd_path, &wc_path, ""),
323+
RepoPath::parse_fs_path(&cwd_path, wc_path, ""),
324324
Ok(RepoPath::root())
325325
);
326326
assert_eq!(
327-
RepoPath::parse_fs_path(&cwd_path, &wc_path, "."),
327+
RepoPath::parse_fs_path(&cwd_path, wc_path, "."),
328328
Ok(RepoPath::root())
329329
);
330330
assert_eq!(
331-
RepoPath::parse_fs_path(&cwd_path, &wc_path, "file"),
331+
RepoPath::parse_fs_path(&cwd_path, wc_path, "file"),
332332
Ok(RepoPath::from_internal_string("file"))
333333
);
334334
// Both slash and the platform's separator are allowed
335335
assert_eq!(
336336
RepoPath::parse_fs_path(
337337
&cwd_path,
338-
&wc_path,
338+
wc_path,
339339
&format!("dir{}file", std::path::MAIN_SEPARATOR)
340340
),
341341
Ok(RepoPath::from_internal_string("dir/file"))
342342
);
343343
assert_eq!(
344-
RepoPath::parse_fs_path(&cwd_path, &wc_path, "dir/file"),
344+
RepoPath::parse_fs_path(&cwd_path, wc_path, "dir/file"),
345345
Ok(RepoPath::from_internal_string("dir/file"))
346346
);
347347
assert_eq!(
348-
RepoPath::parse_fs_path(&cwd_path, &wc_path, ".."),
348+
RepoPath::parse_fs_path(&cwd_path, wc_path, ".."),
349349
Err(FsPathParseError::InputNotInRepo("..".to_string()))
350350
);
351351
assert_eq!(

0 commit comments

Comments
 (0)