Skip to content

Commit

Permalink
refactor: inline "invoke_default" function
Browse files Browse the repository at this point in the history
  • Loading branch information
altsem committed Oct 20, 2024
1 parent 8eaba68 commit 905f901
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/ops/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ pub(crate) fn create_prompt_with_default(
set_prompt(
state,
prompt,
invoke_default,
|state, term, value, context| context(state, term, value),
Box::new(default_fn),
callback,
hide_menu,
Expand All @@ -245,15 +245,6 @@ pub(crate) fn create_prompt_with_default(
})
}

fn invoke_default(
state: &mut State,
term: &mut Term,
value: &str,
context: &fn(&mut State, &mut Term, &str) -> Res<()>,
) -> Res<()> {
context(state, term, value)
}

type DefaultFn = Box<dyn Fn(&State) -> Option<String>>;

pub(crate) fn set_prompt<T: 'static>(
Expand Down

0 comments on commit 905f901

Please sign in to comment.