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
17 .max_depth(2)17 .max_depth(2)
18 .follow_links(false)18 .follow_links(false)
19 .into_iter()19 .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)))
21 {21 {
22 let map = baseline_map22 let map = baseline_map
23 .entry(baseline_entry.path().parent().expect("file in directory").into())23 .entry(baseline_entry.path().parent().expect("file in directory").into())
24 .or_insert(HashMap::default());24 .or_insert_with(HashMap::default);
25 let baseline = std::fs::read(baseline_entry.path()).unwrap();25 let baseline = std::fs::read(baseline_entry.path()).unwrap();
26 let mut lines = baseline.lines().peekable();26 let mut lines = baseline.lines().peekable();
27 while let Some(spec) = lines.next() {27 while let Some(spec) = lines.next() {
@@ -62,7 +62,7 @@ mod from_bytes { · 34 unmodified lines
62 assert_eq!(62 assert_eq!(
63 &actual,63 &actual,
64 BASELINE64 BASELINE
65 .get(repo.work_dir().unwrap_or(repo.git_dir()))65 .get(repo.work_dir().unwrap_or_else(|| repo.git_dir()))
66 .unwrap_or_else(|| panic!("No baseline for {:?}", repo))66 .unwrap_or_else(|| panic!("No baseline for {:?}", repo))
67 .get(&spec)67 .get(&spec)
68 .unwrap_or_else(|| panic!("'{}' revspec not found in git baseline", spec)),68 .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