Skip to content

Commit c073242

Browse files
committed
Apply suggestions and run cargo-fmt.
1 parent 202b89b commit c073242

File tree

16 files changed

+886
-743
lines changed

16 files changed

+886
-743
lines changed

src/cli/mod.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,8 @@ pub mod repl;
1212
#[structopt(name = "pikelet")]
1313
pub struct Opts {
1414
/// Configure coloring of output
15-
#[structopt(
16-
long = "color",
17-
parse(try_from_str),
18-
default_value = "auto",
19-
raw(possible_values = "ColorArg::VARIANTS")
20-
)]
15+
#[structopt(long = "color", parse(try_from_str), default_value = "auto",
16+
raw(possible_values = "ColorArg::VARIANTS"))]
2117
pub color: ColorArg,
2218

2319
/// Subcommand to run

src/cli/repl.rs

+12-11
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,7 @@ pub struct Opts {
2828
pub no_history: bool,
2929

3030
/// 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")]
3632
pub history_file: PathBuf,
3733

3834
/// Files to preload into the REPL
@@ -131,7 +127,8 @@ pub fn run(color: ColorChoice, opts: &Opts) -> Result<(), Error> {
131127
},
132128
}
133129
},
134-
ReadResult::Signal(Signal::Quit) | ReadResult::Eof => break,
130+
ReadResult::Signal(Signal::Quit) |
131+
ReadResult::Eof => break,
135132
ReadResult::Signal(Signal::Interrupt) => println!("Interrupt"),
136133
ReadResult::Signal(_) => {},
137134
}
@@ -158,9 +155,9 @@ fn eval_print(
158155
use syntax::translation::{Desugar, Resugar};
159156

160157
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+
)
164161
}
165162

166163
let (repl_command, parse_errors) = parse::repl_command(filemap);
@@ -219,7 +216,8 @@ fn eval_print(
219216
println!("{}", inferred.resugar().to_doc().pretty(term_width()));
220217
},
221218

222-
ReplCommand::NoOp | ReplCommand::Error(_) => {},
219+
ReplCommand::NoOp |
220+
ReplCommand::Error(_) => {},
223221
ReplCommand::Quit => return Ok(ControlFlow::Break),
224222
}
225223

@@ -237,7 +235,10 @@ enum EvalPrintError {
237235
#[fail(display = "Parse error")]
238236
Parse(Vec<parse::ParseError>),
239237
#[fail(display = "Type error: {}", _0)]
240-
Type(#[cause] semantics::TypeError),
238+
Type(
239+
#[cause]
240+
semantics::TypeError
241+
),
241242
}
242243

243244
impl From<parse::ParseError> for EvalPrintError {

0 commit comments

Comments
 (0)