File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
git-function-history-lib/src Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -439,8 +439,7 @@ fn get_stuff<T: AstNode>(
439
439
let mut content: String = file[ * start..found_start_brace] . to_string ( ) ;
440
440
if & content[ ..1 ] == "\n " {
441
441
content = content[ 1 ..] . to_string ( ) ;
442
- }
443
- (
442
+ } (
444
443
( start_line, end_line) ,
445
444
(
446
445
content
@@ -455,7 +454,7 @@ fn get_stuff<T: AstNode>(
455
454
format ! (
456
455
"\n {}: {}" ,
457
456
end_line,
458
- file. lines( ) . nth( end_line - 1 ) . unwrap_or( "" )
457
+ file. lines( ) . nth( if end_line == file . lines ( ) . count ( ) - 1 { end_line } else { end_line - 1 } ) . unwrap_or( "" )
459
458
) ,
460
459
) ,
461
460
( starts, end_line) ,
@@ -619,7 +618,7 @@ mod tests {
619
618
Ok ( functions) => {
620
619
println ! ( "{:?}" , functions) ;
621
620
}
622
- Err ( e) => println ! ( "{} " , e) ,
621
+ Err ( e) => println ! ( "-{}- " , e) ,
623
622
}
624
623
assert ! ( output. is_ok( ) ) ;
625
624
}
You can’t perform that action at this time.
0 commit comments