We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1a930db commit f6c64f8Copy full SHA for f6c64f8
asyncgit/src/sync/commit_files.rs
@@ -23,20 +23,21 @@ pub fn get_commit_files(
23
get_commit_diff(&repo, id, None)?
24
};
25
26
- let mut res = Vec::with_capacity(diff.deltas().count());
27
-
28
- for delta in diff.deltas() {
29
- let status = StatusItemType::from(delta.status());
30
31
- res.push(StatusItem {
32
- path: delta
33
- .new_file()
34
- .path()
35
- .map(|p| p.to_str().unwrap_or("").to_string())
36
- .unwrap_or_default(),
37
- status,
38
- });
39
- }
+ let res = diff
+ .deltas()
+ .map(|delta| {
+ let status = StatusItemType::from(delta.status());
+
+ StatusItem {
+ path: delta
+ .new_file()
+ .path()
+ .map(|p| p.to_str().unwrap_or("").to_string())
+ .unwrap_or_default(),
+ status,
+ }
+ })
40
+ .collect::<Vec<_>>();
41
42
Ok(res)
43
}
0 commit comments