File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,11 @@ impl Cli {
4949 option : Some ( "layout" . into ( ) ) ,
5050 } ) ;
5151 } ;
52- c. settings . layout = Layout :: from_str ( l) ?;
52+ c. settings . layout =
53+ Layout :: from_str ( l) . map_err ( |_| lexopt:: Error :: UnexpectedValue {
54+ option : "layout" . into ( ) ,
55+ value : l. into ( ) ,
56+ } ) ?;
5357 }
5458 Short ( 'M' ) | Long ( "no-modeline" ) => c. modeline = false ,
5559 Short ( 'f' ) | Long ( "prefix-func" ) => c. settings . prefix_func = true ,
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ pub enum Layout {
3434}
3535
3636impl FromStr for Layout {
37- type Err = lexopt :: Error ;
37+ type Err = ( ) ;
3838 fn from_str ( s : & str ) -> Result < Self , Self :: Err > {
3939 match s {
4040 "default" => Ok ( Self :: Default ) ,
@@ -47,10 +47,7 @@ impl FromStr for Layout {
4747 ( Some ( "mini" ) , n) => {
4848 Ok ( Self :: Mini ( n. map_or ( 0 , |x| x. parse ( ) . unwrap_or_default ( ) ) ) )
4949 }
50- _ => Err ( lexopt:: Error :: UnexpectedValue {
51- option : "layout" . into ( ) ,
52- value : x. into ( ) ,
53- } ) ,
50+ _ => Err ( ( ) ) ,
5451 }
5552 }
5653 }
You can’t perform that action at this time.
0 commit comments