@@ -14,11 +14,10 @@ pub fn log(mut repo: gix::Repository, out: &mut dyn std::io::Write, path: Option
1414
1515fn log_all ( repo : gix:: Repository , out : & mut dyn std:: io:: Write ) -> Result < ( ) , anyhow:: Error > {
1616 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 ( ) ?;
2019
21- while let Some ( info) = topo. next ( ) {
20+ for info in topo {
2221 let info = info?;
2322
2423 write_info ( & repo, & mut * out, & info) ?;
@@ -29,11 +28,10 @@ fn log_all(repo: gix::Repository, out: &mut dyn std::io::Write) -> Result<(), an
2928
3029fn log_file ( repo : gix:: Repository , out : & mut dyn std:: io:: Write , path : BString ) -> anyhow:: Result < ( ) > {
3130 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 ( ) ?;
3533
36- while let Some ( info) = topo. next ( ) {
34+ for info in topo {
3735 let info = info?;
3836 let commit = repo. find_commit ( info. id ) . unwrap ( ) ;
3937
@@ -113,7 +111,7 @@ fn write_info(
113111 out,
114112 "{} {}" ,
115113 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 )
117115 ) ?;
118116
119117 Ok ( ( ) )
0 commit comments