Skip to content

Commit

Permalink
Move to_delete into closure
Browse files Browse the repository at this point in the history
  • Loading branch information
autarch committed Nov 2, 2023
1 parent f3cc858 commit 904c550
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ fn make_ubi<'a>(mut matches: ArgMatches) -> Result<(Ubi<'a>, Option<impl FnOnce(
let (args, to_delete) = self_upgrade_args()?;
matches = cmd.try_get_matches_from(args)?;
if let Some(to_delete) = to_delete {
post_run = Some(|| {
let to_delete = to_delete;
post_run = Some(move || {
println!(
"The self-upgrade operation left an old binary behind that must be deleted manually: {}",
to_delete.display(),
Expand Down

0 comments on commit 904c550

Please sign in to comment.