Format code with rustfmt

This commit is contained in:
Nicolas Musset 2021-08-21 22:20:17 +09:00
parent f8c49ca661
commit a78e6d3e4b
No known key found for this signature in database
GPG key ID: 090B167B09F29DB2
2 changed files with 22 additions and 20 deletions

View file

@ -1,5 +1,5 @@
use clap::clap_app;
use jsonformat::{Indentation, format_json_buffered};
use jsonformat::{format_json_buffered, Indentation};
use std::error::Error;
use std::fs::File;
use std::io::{BufReader, BufWriter, Read, Write};
@ -17,13 +17,8 @@ fn main() -> Result<(), Box<dyn Error>> {
.get_matches();
let reader: Box<dyn Read> = match matches.value_of("input") {
Some(path) => {
let f = File::open(path)?;
Box::new(BufReader::new(f))
},
None => {
Box::new(std::io::stdin())
}
Some(path) => Box::new(File::open(path)?),
None => Box::new(std::io::stdin()),
};
let replaced_indent = matches.value_of("indentation").map(|value| {
@ -55,10 +50,8 @@ fn main() -> Result<(), Box<dyn Error>> {
output = windows_output_default_file.as_deref().or(output);
let writer : Box<dyn Write> = match output {
Some(file) => {
Box::new(File::create(file)?)
}
let writer: Box<dyn Write> = match output {
Some(file) => Box::new(File::create(file)?),
None => Box::new(std::io::stdout()),
};