File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ where
101
101
input. read_line ( & mut in_line) ?;
102
102
let number_input = in_line
103
103
. parse ( )
104
- . or_else ( |_| Err ( Error :: InvalidPancake ( in_line. clone ( ) ) ) ) ?;
104
+ . map_err ( |_| Error :: InvalidPancake ( in_line. clone ( ) ) ) ?;
105
105
stack. push ( number_input) ;
106
106
in_line. clear ( ) ;
107
107
}
@@ -301,7 +301,7 @@ where
301
301
input. read_line ( & mut in_line) ?;
302
302
let number_input = in_line
303
303
. parse ( )
304
- . or_else ( |_| Err ( Error :: InvalidPancake ( in_line. clone ( ) ) ) ) ?;
304
+ . map_err ( |_| Error :: InvalidPancake ( in_line. clone ( ) ) ) ?;
305
305
stack. push ( number_input) ;
306
306
in_line. clear ( ) ;
307
307
}
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ use std::fmt::{self, Display};
18
18
/// # }
19
19
/// ```
20
20
#[ must_use]
21
- pub fn parse_program_str < ' a > ( program : & ' a str ) -> Vec < BorrowedCommand < ' a > > {
21
+ pub fn parse_program_str ( program : & str ) -> Vec < BorrowedCommand > {
22
22
program
23
23
. lines ( )
24
24
. filter_map ( |line| BorrowedCommand :: from_line ( line) . ok ( ) )
You can’t perform that action at this time.
0 commit comments