@@ -17,9 +17,9 @@ use git2::{
1717use glob:: Pattern ;
1818use indexmap:: IndexMap ;
1919use lazy_regex:: {
20- lazy_regex,
2120 Lazy ,
2221 Regex ,
22+ lazy_regex,
2323} ;
2424use std:: io;
2525use std:: path:: {
@@ -238,12 +238,11 @@ impl Repository {
238238 . expect ( "failed to add '**' to the end of glob" ) ,
239239 _ => pattern,
240240 } ;
241- let pattern_normal = match star_added. as_str ( ) . strip_prefix ( "./" ) {
241+ match star_added. as_str ( ) . strip_prefix ( "./" ) {
242242 Some ( stripped) => Pattern :: new ( stripped)
243243 . expect ( "failed to remove leading ./ from glob" ) ,
244244 None => star_added,
245- } ;
246- pattern_normal
245+ }
247246 }
248247
249248 /// Calculates whether the commit should be retained or not.
@@ -710,9 +709,11 @@ mod test {
710709 #[ test]
711710 fn commit_search ( ) -> Result < ( ) > {
712711 let repository = get_repository ( ) ?;
713- assert ! ( repository
714- . find_commit( "e936ed571533ea6c41a1dd2b1a29d085c8dbada5" )
715- . is_some( ) ) ;
712+ assert ! (
713+ repository
714+ . find_commit( "e936ed571533ea6c41a1dd2b1a29d085c8dbada5" )
715+ . is_some( )
716+ ) ;
716717 Ok ( ( ) )
717718 }
718719
@@ -912,10 +913,12 @@ mod test {
912913
913914 assert ! ( result. is_err( ) ) ;
914915 if let Err ( error) = result {
915- assert ! ( format!( "{error:?}" ) . contains(
916- format!( "could not find repository at '{}'" , path. display( ) )
917- . as_str( )
918- ) )
916+ assert ! (
917+ format!( "{error:?}" ) . contains(
918+ format!( "could not find repository at '{}'" , path. display( ) )
919+ . as_str( )
920+ )
921+ )
919922 }
920923 }
921924
@@ -945,13 +948,10 @@ mod test {
945948 . expect ( "failed to execute git commit" ) ;
946949 assert ! ( output. status. success( ) , "git commit failed {:?}" , output) ;
947950
948- let last_commit = repo
949- . inner
951+ repo. inner
950952 . head ( )
951953 . and_then ( |head| head. peel_to_commit ( ) )
952- . expect ( "failed to get the last commit" ) ;
953-
954- last_commit
954+ . expect ( "failed to get the last commit" )
955955 }
956956
957957 #[ test]
0 commit comments