Skip to content

Commit

Permalink
Simplify format initialization
Browse files Browse the repository at this point in the history
Avoid using a mutable variable.
  • Loading branch information
cgzones authored and etke committed Oct 8, 2022
1 parent d90389e commit 0a65a4b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,15 @@ fn main() {
let procname = args.value_of("process");
let procall = args.is_present("process-all");

let mut format = output::Format::Text;
if args.is_present("json") {
format = output::Format::Json;
let format = if args.is_present("json") {
if args.is_present("pretty") {
format = output::Format::JsonPretty;
output::Format::JsonPretty
} else {
output::Format::Json
}
}
} else {
output::Format::Text
};

let settings = output::Settings::set(
#[cfg(feature = "color")]
Expand Down

0 comments on commit 0a65a4b

Please sign in to comment.