refactor: Move Args::partition call after panic::set_hook

This commit is contained in:
Martin Fischer 2023-01-25 04:17:03 +01:00 committed by Charlie Marsh
parent f7be192f8b
commit cebea16fe4
1 changed files with 3 additions and 1 deletions

View File

@ -36,7 +36,7 @@ pub mod updates;
fn inner_main() -> Result<ExitCode> {
// Extract command-line arguments.
let (cli, overrides) = Args::parse().partition();
let args = Args::parse();
let default_panic_hook = std::panic::take_hook();
std::panic::set_hook(Box::new(move |info| {
@ -53,6 +53,8 @@ quoting the executed command, along with the relevant file contents and `pyproje
default_panic_hook(info);
}));
let (cli, overrides) = args.partition();
let log_level = extract_log_level(&cli);
set_up_logging(&log_level)?;