Skip to content

Commit 2e05284

Browse files
committed
limit cliargs mut scope (more localized)
1 parent e61a5a6 commit 2e05284

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/main.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ macro_rules! log_eprintln {
165165
fn main() -> Result<()> {
166166
let app_start = Instant::now();
167167

168-
let mut cliargs = process_cmdline()?;
168+
let cliargs = process_cmdline()?;
169169

170170
asyncgit::register_tracing_logging();
171171
ensure_valid_path(&cliargs.repo_path)?;
@@ -192,10 +192,12 @@ fn main() -> Result<()> {
192192
Updater::Ticker
193193
};
194194

195+
let mut args = cliargs;
196+
195197
loop {
196198
let quit_state = run_app(
197199
app_start,
198-
cliargs.clone(),
200+
args.clone(),
199201
theme.clone(),
200202
key_config.clone(),
201203
&input,
@@ -205,11 +207,11 @@ fn main() -> Result<()> {
205207

206208
match quit_state {
207209
QuitState::OpenSubmodule(p) => {
208-
cliargs = CliArgs {
210+
args = CliArgs {
209211
repo_path: p,
210212
select_file: None,
211-
theme: cliargs.theme,
212-
notify_watcher: cliargs.notify_watcher,
213+
theme: args.theme,
214+
notify_watcher: args.notify_watcher,
213215
}
214216
}
215217
_ => break,

0 commit comments

Comments
 (0)