on master help sign in
clippy: Drop or-patterns for now because they're not on stable rust yet
0e9ecccBlaž Hrastnik
helix-lsp/src/client.rs+7−9
@@ -384,13 +384,11 @@ impl Client {
384 let capabilities = self.capabilities.as_ref().unwrap();
384 let capabilities = self.capabilities.as_ref().unwrap();
385
385
386 let sync_capabilities = match capabilities.text_document_sync {
386 let sync_capabilities = match capabilities.text_document_sync {
387− Some(
388− lsp::TextDocumentSyncCapability::Kind(kind)
387+ Some(lsp::TextDocumentSyncCapability::Kind(kind))
389− | lsp::TextDocumentSyncCapability::Options(lsp::TextDocumentSyncOptions {
388+ | Some(lsp::TextDocumentSyncCapability::Options(lsp::TextDocumentSyncOptions {
390− change: Some(kind),
389+ change: Some(kind),
391− ..
390+ ..
392− }),
393− ) => kind,
391+ })) => kind,
394 // None | SyncOptions { changes: None }
392 // None | SyncOptions { changes: None }
395 _ => return Ok(()),
393 _ => return Ok(()),
396 };
394 };
@@ -540,7 +538,7 @@ impl Client {
540
538
541 // check if we're able to format
539 // check if we're able to format
542 match capabilities.document_formatting_provider {
540 match capabilities.document_formatting_provider {
543− Some(lsp::OneOf::Left(true) | lsp::OneOf::Right(_)) => (),
541+ Some(lsp::OneOf::Left(true)) | Some(lsp::OneOf::Right(_)) => (),
544 // None | Some(false)
542 // None | Some(false)
545 _ => return Ok(Vec::new()),
543 _ => return Ok(Vec::new()),
546 };
544 };
@@ -569,7 +567,7 @@ impl Client {
569
567
570 // check if we're able to format
568 // check if we're able to format
571 match capabilities.document_range_formatting_provider {
569 match capabilities.document_range_formatting_provider {
572− Some(lsp::OneOf::Left(true) | lsp::OneOf::Right(_)) => (),
570+ Some(lsp::OneOf::Left(true)) | Some(lsp::OneOf::Right(_)) => (),
573 // None | Some(false)
571 // None | Some(false)
574 _ => return Ok(Vec::new()),
572 _ => return Ok(Vec::new()),
575 };
573 };
helix-term/src/commands.rs+3−3
@@ -821,15 +821,15 @@ pub fn command_mode(cx: &mut Context) {
821 let parts = input.split_ascii_whitespace().collect::<Vec<&str>>();
821 let parts = input.split_ascii_whitespace().collect::<Vec<&str>>();
822
822
823 match *parts.as_slice() {
823 match *parts.as_slice() {
824− ["q" | "quit"] => {
824+ ["q"] | ["quit"] => {
825 editor.close(editor.view().id);
825 editor.close(editor.view().id);
826 // editor.should_close = true,
826 // editor.should_close = true,
827 }
827 }
828− ["o" | "open", path] => {
828+ ["o", path] | ["open", path] => {
829 use helix_view::editor::Action;
829 use helix_view::editor::Action;
830 editor.open(path.into(), Action::Replace);
830 editor.open(path.into(), Action::Replace);
831 }
831 }
832− ["w" | "write"] => {
832+ ["w"] | ["write"] => {
833 // TODO: non-blocking via save() command
833 // TODO: non-blocking via save() command
834 let id = editor.view().doc;
834 let id = editor.view().doc;
835 let doc = &mut editor.documents[id];
835 let doc = &mut editor.documents[id];
helix-term/src/ui/prompt.rs+5−1
@@ -182,7 +182,11 @@ impl Component for Prompt {
182 // char or shift char
182 // char or shift char
183 KeyEvent {
183 KeyEvent {
184 code: KeyCode::Char(c),
184 code: KeyCode::Char(c),
185− modifiers: KeyModifiers::NONE | KeyModifiers::SHIFT,
185+ modifiers: KeyModifiers::NONE,
186+ }
187+ | KeyEvent {
188+ code: KeyCode::Char(c),
189+ modifiers: KeyModifiers::SHIFT,
186 } => {
190 } => {
187 self.insert_char(c);
191 self.insert_char(c);
188 (self.callback_fn)(cx.editor, &self.line, PromptEvent::Update);
192 (self.callback_fn)(cx.editor, &self.line, PromptEvent::Update);