Skip to content

Commit df91215

Browse files
committed
thanks clippy
1 parent 220b943 commit df91215

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

src/index.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,7 @@ impl Index {
187187
None,
188188
)
189189
})?;
190-
let latest_fetched_commit_oid =
191-
self.repo.refname_to_id("refs/remotes/origin/master")?;
192-
latest_fetched_commit_oid
190+
self.repo.refname_to_id("refs/remotes/origin/master")?
193191
};
194192

195193
Ok((

tests/index.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ use tempdir::TempDir;
55

66
const NUM_VERSIONS_AT_RECENT_COMMIT: usize = 39752;
77
// TODO: find new hashes for the ones below with similar states as they don't exist anymore. See ignored tests.
8-
const REV_ONE_ADDED: &'static str = "615c9c41942a3ba13e088fbcb1470c61b169a187";
9-
const REV_ONE_YANKED: &'static str = "8cf8fbad7876586ced34c4b778f6a80fadd2a59b";
10-
const REV_ONE_UNYANKED: &'static str = "f8cb00181";
8+
const REV_ONE_ADDED: &str = "615c9c41942a3ba13e088fbcb1470c61b169a187";
9+
const REV_ONE_YANKED: &str = "8cf8fbad7876586ced34c4b778f6a80fadd2a59b";
10+
const REV_ONE_UNYANKED: &str = "f8cb00181";
1111
const REV_CRATE_DELETE: &str = "de5be3e8bb6cd7a3179857bdbdf28ca4fa23f84c";
1212

1313
#[test]
@@ -23,7 +23,7 @@ fn make_index() -> (Index, TempDir) {
2323
let index = Index::from_path_or_cloned(
2424
env::var("CRATES_INDEX_DIFF_TEST_EXISTING_INDEX")
2525
.map(PathBuf::from)
26-
.unwrap_or(tmp.path().to_owned()),
26+
.unwrap_or_else(|_| tmp.path().to_owned()),
2727
)
2828
.expect("successful clone");
2929
(index, tmp)
@@ -210,8 +210,8 @@ fn quick_traverse_yanked_crates() {
210210
#[ignore]
211211
fn quick_traverse_added_crates() {
212212
let (index, _tmp) = make_index();
213-
assert_eq!(index.changes("foo", REV_ONE_ADDED).is_err(), true);
214-
assert_eq!(index.changes(REV_ONE_ADDED, "bar").is_err(), true);
213+
assert!(index.changes("foo", REV_ONE_ADDED).is_err());
214+
assert!(index.changes(REV_ONE_ADDED, "bar").is_err());
215215

216216
let crates = changes_of(&index, REV_ONE_ADDED);
217217
assert_eq!(

0 commit comments

Comments
 (0)