Skip to content

Commit

Permalink
Address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoub-benali committed Mar 19, 2023
1 parent d259860 commit 060667b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions helix-term/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2117,7 +2117,7 @@ fn global_search(cx: &mut Context) {
all_matches,
current_path,
move |cx, file_result, action| {
let Some(FileResult { path, line_num }) = file_result else { return; };
let Some(FileResult { path, line_num }) = file_result else { return };
match cx.editor.open(path, action) {
Ok(_) => {}
Err(e) => {
Expand Down Expand Up @@ -2498,7 +2498,7 @@ fn buffer_picker(cx: &mut Context) {
.collect(),
(),
|cx, buffer_meta, action| {
let Some(meta) = buffer_meta else { return; };
let Some(meta) = buffer_meta else { return };
cx.editor.switch(meta.id, action);
},
|editor, meta| {
Expand Down Expand Up @@ -2581,7 +2581,7 @@ fn jumplist_picker(cx: &mut Context) {
.collect(),
(),
|cx, jump_meta, action| {
let Some(meta) = jump_meta else {return;};
let Some(meta) = jump_meta else { return };
cx.editor.switch(meta.id, action);
let config = cx.editor.config();
let (view, doc) = current!(cx.editor);
Expand Down Expand Up @@ -2643,7 +2643,7 @@ pub fn command_palette(cx: &mut Context) {
}));

let picker = Picker::new(commands, keymap, move |cx, mappable_command, _action| {
let Some(command) = mappable_command else {return;};
let Some(command) = mappable_command else { return };
let mut ctx = Context {
register: None,
count: std::num::NonZeroUsize::new(1),
Expand Down
6 changes: 3 additions & 3 deletions helix-term/src/commands/lsp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ fn sym_picker(
symbols,
current_path.clone(),
move |cx, symbol_information, action| {
let Some(symbol) = symbol_information else {return;};
let Some(symbol) = symbol_information else { return };
let (view, doc) = current!(cx.editor);
push_jump(view, doc);

Expand Down Expand Up @@ -295,7 +295,7 @@ fn diag_picker(
flat_diag,
(styles, format),
move |cx, picker_diagnostic, action| {
let Some(PickerDiagnostic { url, diag }) = picker_diagnostic else {return;};
let Some(PickerDiagnostic { url, diag }) = picker_diagnostic else { return };
if current_path.as_ref() == Some(url) {
let (view, doc) = current!(cx.editor);
push_jump(view, doc);
Expand Down Expand Up @@ -960,7 +960,7 @@ fn goto_impl(
locations,
cwdir,
move |cx, location, action| {
let Some(l) = location else {return;};
let Some(l) = location else { return };
jump_to_location(cx.editor, l, offset_encoding, action)
},
move |_editor, location| Some(location_to_file_location(location)),
Expand Down
2 changes: 1 addition & 1 deletion helix-term/src/commands/typed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1333,7 +1333,7 @@ fn lsp_workspace_command(
let call: job::Callback = Callback::EditorCompositor(Box::new(
move |_editor: &mut Editor, compositor: &mut Compositor| {
let picker = ui::Picker::new(commands, (), |cx, command, _action| {
let Some(c) = command else {return;};
let Some(c) = command else { return };
execute_lsp_command(cx.editor, c.clone());
});
compositor.push(Box::new(overlayed(picker)))
Expand Down
2 changes: 1 addition & 1 deletion helix-term/src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ pub fn file_picker(root: PathBuf, config: &helix_view::editor::Config) -> FilePi
files,
root,
move |cx, path_buff, action| {
let Some(path) = path_buff else {return;};
let Some(path) = path_buff else { return };
if let Err(e) = cx.editor.open(path, action) {
let err = if let Some(err) = e.source() {
format!("{}", err)
Expand Down

0 comments on commit 060667b

Please sign in to comment.