@@ -364,9 +364,7 @@ impl<'i> RecipeCollector<'i, '_> {
364364 format!( "Unknown config metadata key: {key_t}" ) ,
365365 label!( key. span( ) )
366366 )
367- . hint (
368- "Possible config keys are '[mode]' and '[duplicate]''" ,
369- ) ,
367+ . hint ( "Possible config keys are '[mode]' and '[duplicate]''" ) ,
370368 ) ;
371369 if self . old_style_metadata {
372370 self . content . metadata . map . insert (
@@ -1029,7 +1027,10 @@ impl<'i> RecipeCollector<'i, '_> {
10291027 }
10301028
10311029 fn value ( & mut self , value : parser:: QuantityValue , is_ingredient : bool ) -> ScalableValue {
1032- let parser:: QuantityValue { value, scaling_lock } = value;
1030+ let parser:: QuantityValue {
1031+ value,
1032+ scaling_lock,
1033+ } = value;
10331034 let has_scaling_lock = scaling_lock. is_some ( ) ;
10341035 let is_text = value. is_text ( ) ;
10351036
@@ -1496,13 +1497,17 @@ fn yaml_find_key_position(text: &str, key: &str) -> Option<usize> {
14961497}
14971498
14981499fn parse_reference ( name : & str ) -> Option < RecipeReference > {
1499- if name. starts_with ( "./" ) || name. starts_with ( "../" ) || name. starts_with ( ".\\ " ) || name. starts_with ( "..\\ " ) {
1500+ if name. starts_with ( "./" )
1501+ || name. starts_with ( "../" )
1502+ || name. starts_with ( ".\\ " )
1503+ || name. starts_with ( "..\\ " )
1504+ {
15001505 let path = name. replace ( '\\' , "/" ) ;
15011506 let mut components: Vec < String > = path. split ( '/' ) . map ( String :: from) . skip ( 1 ) . collect ( ) ;
15021507 let file_stem = components. pop ( ) . unwrap ( ) ;
15031508 Some ( RecipeReference {
15041509 components,
1505- name : file_stem. into ( )
1510+ name : file_stem,
15061511 } )
15071512 } else {
15081513 None
@@ -1553,7 +1558,11 @@ mod tests {
15531558 assert_eq ! (
15541559 parse_reference( "./recipes/italian/pasta/spaghetti" ) ,
15551560 Some ( RecipeReference {
1556- components: vec![ "recipes" . to_string( ) , "italian" . to_string( ) , "pasta" . to_string( ) ] ,
1561+ components: vec![
1562+ "recipes" . to_string( ) ,
1563+ "italian" . to_string( ) ,
1564+ "pasta" . to_string( )
1565+ ] ,
15571566 name: "spaghetti" . into( )
15581567 } )
15591568 ) ;
0 commit comments