@@ -14,11 +14,10 @@ pub fn log(mut repo: gix::Repository, out: &mut dyn std::io::Write, path: Option
14
14
15
15
fn log_all ( repo : gix:: Repository , out : & mut dyn std:: io:: Write ) -> Result < ( ) , anyhow:: Error > {
16
16
let head = repo. head ( ) ?. peel_to_commit_in_place ( ) ?;
17
- let mut topo =
18
- gix:: traverse:: commit:: topo:: Builder :: from_iters ( & repo. objects , [ head. id ] , None :: < Vec < gix:: ObjectId > > )
19
- . build ( ) ?;
17
+ let topo = gix:: traverse:: commit:: topo:: Builder :: from_iters ( & repo. objects , [ head. id ] , None :: < Vec < gix:: ObjectId > > )
18
+ . build ( ) ?;
20
19
21
- while let Some ( info) = topo. next ( ) {
20
+ for info in topo {
22
21
let info = info?;
23
22
24
23
write_info ( & repo, & mut * out, & info) ?;
@@ -29,11 +28,10 @@ fn log_all(repo: gix::Repository, out: &mut dyn std::io::Write) -> Result<(), an
29
28
30
29
fn log_file ( repo : gix:: Repository , out : & mut dyn std:: io:: Write , path : BString ) -> anyhow:: Result < ( ) > {
31
30
let head = repo. head ( ) ?. peel_to_commit_in_place ( ) ?;
32
- let mut topo =
33
- gix:: traverse:: commit:: topo:: Builder :: from_iters ( & repo. objects , [ head. id ] , None :: < Vec < gix:: ObjectId > > )
34
- . build ( ) ?;
31
+ let topo = gix:: traverse:: commit:: topo:: Builder :: from_iters ( & repo. objects , [ head. id ] , None :: < Vec < gix:: ObjectId > > )
32
+ . build ( ) ?;
35
33
36
- while let Some ( info) = topo. next ( ) {
34
+ for info in topo {
37
35
let info = info?;
38
36
let commit = repo. find_commit ( info. id ) . unwrap ( ) ;
39
37
@@ -113,7 +111,7 @@ fn write_info(
113
111
out,
114
112
"{} {}" ,
115
113
info. id. to_hex_with_len( 8 ) ,
116
- title. map ( BString :: from ) . unwrap_or_else ( || "<no message>" . into( ) )
114
+ title. map_or_else ( || "<no message>" . into( ) , BString :: from )
117
115
) ?;
118
116
119
117
Ok ( ( ) )
0 commit comments