History

thanks clippy

Sebastian Thiel committed 4 years ago

Commit e898bfa1 parent a018fc61 file · +3 −3Browse files

Unified · Split

git-repository/tests/rev_spec/mod.rs+3−3
@@ -17,11 +17,11 @@ mod from_bytes { · 16 unmodified lines
1717 .max_depth(2)
1818 .follow_links(false)
1919 .into_iter()
20− .filter_map(|e| e.ok().map(|e| (e.file_name() == "baseline.git").then(|| e)).flatten())
20+ .filter_map(|e| e.ok().and_then(|e| (e.file_name() == "baseline.git").then(|| e)))
2121 {
2222 let map = baseline_map
2323 .entry(baseline_entry.path().parent().expect("file in directory").into())
24− .or_insert(HashMap::default());
24+ .or_insert_with(HashMap::default);
2525 let baseline = std::fs::read(baseline_entry.path()).unwrap();
2626 let mut lines = baseline.lines().peekable();
2727 while let Some(spec) = lines.next() {
@@ -62,7 +62,7 @@ mod from_bytes { · 34 unmodified lines
6262 assert_eq!(
6363 &actual,
6464 BASELINE
65− .get(repo.work_dir().unwrap_or(repo.git_dir()))
65+ .get(repo.work_dir().unwrap_or_else(|| repo.git_dir()))
6666 .unwrap_or_else(|| panic!("No baseline for {:?}", repo))
6767 .get(&spec)
6868 .unwrap_or_else(|| panic!("'{}' revspec not found in git baseline", spec)),

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t