@@ -28,11 +28,7 @@ pub struct Opts {
28
28
pub no_history : bool ,
29
29
30
30
/// The file to save the command history to
31
- #[ structopt(
32
- long = "history-file" ,
33
- parse( from_os_str) ,
34
- default_value = "repl-history"
35
- ) ]
31
+ #[ structopt( long = "history-file" , parse( from_os_str) , default_value = "repl-history" ) ]
36
32
pub history_file : PathBuf ,
37
33
38
34
/// Files to preload into the REPL
@@ -131,7 +127,8 @@ pub fn run(color: ColorChoice, opts: &Opts) -> Result<(), Error> {
131
127
} ,
132
128
}
133
129
} ,
134
- ReadResult :: Signal ( Signal :: Quit ) | ReadResult :: Eof => break ,
130
+ ReadResult :: Signal ( Signal :: Quit ) |
131
+ ReadResult :: Eof => break ,
135
132
ReadResult :: Signal ( Signal :: Interrupt ) => println ! ( "Interrupt" ) ,
136
133
ReadResult :: Signal ( _) => { } ,
137
134
}
@@ -158,9 +155,9 @@ fn eval_print(
158
155
use syntax:: translation:: { Desugar , Resugar } ;
159
156
160
157
fn term_width ( ) -> usize {
161
- term_size:: dimensions ( )
162
- . map ( | ( width , _ ) | width )
163
- . unwrap_or ( pretty :: FALLBACK_WIDTH )
158
+ term_size:: dimensions ( ) . map ( | ( width , _ ) | width ) . unwrap_or (
159
+ pretty :: FALLBACK_WIDTH ,
160
+ )
164
161
}
165
162
166
163
let ( repl_command, parse_errors) = parse:: repl_command ( filemap) ;
@@ -219,7 +216,8 @@ fn eval_print(
219
216
println ! ( "{}" , inferred. resugar( ) . to_doc( ) . pretty( term_width( ) ) ) ;
220
217
} ,
221
218
222
- ReplCommand :: NoOp | ReplCommand :: Error ( _) => { } ,
219
+ ReplCommand :: NoOp |
220
+ ReplCommand :: Error ( _) => { } ,
223
221
ReplCommand :: Quit => return Ok ( ControlFlow :: Break ) ,
224
222
}
225
223
@@ -237,7 +235,10 @@ enum EvalPrintError {
237
235
#[ fail( display = "Parse error" ) ]
238
236
Parse ( Vec < parse:: ParseError > ) ,
239
237
#[ fail( display = "Type error: {}" , _0) ]
240
- Type ( #[ cause] semantics:: TypeError ) ,
238
+ Type (
239
+ #[ cause]
240
+ semantics:: TypeError
241
+ ) ,
241
242
}
242
243
243
244
impl From < parse:: ParseError > for EvalPrintError {
0 commit comments