diff --git a/rust/hgcli/src/main.rs b/rust/hgcli/src/main.rs --- a/rust/hgcli/src/main.rs +++ b/rust/hgcli/src/main.rs @@ -177,8 +177,7 @@ python27_sys::PySys_SetArgvEx(args.len() as c_int, argv.as_ptr() as *mut *mut i8, 0); } - let result; - { + let result = { // These need to be dropped before we call Py_Finalize(). Hence the // block. let gil = Python::acquire_gil(); @@ -189,7 +188,7 @@ // TODO this may cause issues on Windows due to the CRT mismatch. // Investigate if we can intercept sys.exit() or SystemExit() to // ensure we handle process exit. - result = match run_py(&env, py) { + match run_py(&env, py) { // Print unhandled exceptions and exit code 1, as this is what // `python` does. Err(err) => { @@ -205,8 +204,8 @@ }; Err(code) } - }; - } + } + }; unsafe { python27_sys::Py_Finalize();