Skip to content

Commit

Permalink
Add clippy suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Mazurel committed May 29, 2022
1 parent da816a2 commit dc28874
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions helix-term/src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -726,14 +726,13 @@ impl Application {
&self.editor,
"File is big. Do you want to enable syntax highlighting anyway (it will slow down the editor) ? ".into(),
ui::YesNoAnswer::No,
move |cx: &mut crate::compositor::Context, answer: ui::YesNoAnswer| match answer {
ui::YesNoAnswer::Yes => {
move |cx: &mut crate::compositor::Context, answer: ui::YesNoAnswer| {
if let ui::YesNoAnswer::Yes = answer {
let view = cx.editor.tree.get(cx.editor.tree.focus);
let document_in_focus = cx.editor.documents.get_mut(&view.doc).unwrap();
document_in_focus.enable_syntax = true;
document_in_focus.detect_language(cx.editor.syn_loader.clone());
}
_ => {}
},
)),
};
Expand Down
5 changes: 2 additions & 3 deletions helix-term/src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ pub fn yesno_prompt(
prompt,
None,
completers::yesno,
move |cx: &mut crate::compositor::Context, input: &str, event: PromptEvent| match event {
PromptEvent::Validate => {
move |cx: &mut crate::compositor::Context, input: &str, event: PromptEvent| {
if let PromptEvent::Validate = event {
let answer = match input {
"yes" => YesNoAnswer::Yes,
"no" => YesNoAnswer::No,
Expand All @@ -138,7 +138,6 @@ pub fn yesno_prompt(

callback_fn(cx, answer);
}
_ => {}
},
);

Expand Down

0 comments on commit dc28874

Please sign in to comment.