File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ pub fn estimate_hours(
28
28
let mut hours = 0.0 ;
29
29
30
30
let mut commits = commits. iter ( ) . map ( |t| & t. 1 ) . rev ( ) ;
31
- let mut cur = commits. next ( ) . expect ( "not a single commit found " ) ;
31
+ let mut cur = commits. next ( ) . expect ( "at least one commit if we are here " ) ;
32
32
33
33
for next in commits {
34
34
let change_in_minutes = ( next. time . seconds . saturating_sub ( cur. time . seconds ) ) as f32 / MINUTES_PER_HOUR ;
@@ -37,7 +37,6 @@ pub fn estimate_hours(
37
37
} else {
38
38
hours += FIRST_COMMIT_ADDITION_IN_MINUTES / MINUTES_PER_HOUR
39
39
}
40
-
41
40
cur = next;
42
41
}
43
42
Original file line number Diff line number Diff line change @@ -55,10 +55,10 @@ where
55
55
// estimate lower bound of capacity needed
56
56
let ( lower, _) = iter. size_hint ( ) ;
57
57
let mut result = String :: with_capacity ( sep. len ( ) * lower) ;
58
- write ! ( & mut result, "{first_elt}" ) . unwrap ( ) ;
58
+ write ! ( & mut result, "{first_elt}" ) . expect ( "enough memory" ) ;
59
59
iter. for_each ( |elt| {
60
60
result. push_str ( sep) ;
61
- write ! ( & mut result, "{elt}" ) . unwrap ( ) ;
61
+ write ! ( & mut result, "{elt}" ) . expect ( "enough memory" ) ;
62
62
} ) ;
63
63
result
64
64
}
You can’t perform that action at this time.
0 commit comments