on master help sign in
cargo fmt + clippy lint
4080341Blaž Hrastnik
helix-core/src/syntax.rs+2−4
@@ -436,7 +436,7 @@ impl Syntax {
436 };
436 };
437
437
438 syntax
438 syntax
439− .update(source, source, &ChangeSet::new(&source))
439+ .update(source, source, &ChangeSet::new(source))
440 .unwrap();
440 .unwrap();
441
441
442 syntax
442 syntax
@@ -735,9 +735,7 @@ impl Syntax {
735 .peekable();
735 .peekable();
736
736
737 // If there's no captures, skip the layer
737 // If there's no captures, skip the layer
738− if captures.peek().is_none() {
738+ captures.peek()?;
739− return None;
740− }
741
739
742 Some(HighlightIterLayer {
740 Some(HighlightIterLayer {
743 highlight_end_stack: Vec::new(),
741 highlight_end_stack: Vec::new(),
helix-view/src/document.rs+1−5
@@ -594,11 +594,7 @@ impl Document {
594
594
595 /// Set the programming language for the file if you know the name (scope) but don't have the
595 /// Set the programming language for the file if you know the name (scope) but don't have the
596 /// [`syntax::LanguageConfiguration`] for it.
596 /// [`syntax::LanguageConfiguration`] for it.
597− pub fn set_language2(
598− &mut self,
599− scope: &str,
600− config_loader: Arc<syntax::Loader>,
597+ pub fn set_language2(&mut self, scope: &str, config_loader: Arc<syntax::Loader>) {
601− ) {
602 let language_config = config_loader.language_config_for_scope(scope);
598 let language_config = config_loader.language_config_for_scope(scope);
603
599
604 self.set_language(language_config, Some(config_loader));
600 self.set_language(language_config, Some(config_loader));
helix-view/src/editor.rs+1−5
@@ -456,11 +456,7 @@ impl Editor {
456 let id = if let Some(id) = id {
456 let id = if let Some(id) = id {
457 id
457 id
458 } else {
458 } else {
459− let mut doc = Document::open(
460− &path,
461− None,
462− Some(self.syn_loader.clone()),
459+ let mut doc = Document::open(&path, None, Some(self.syn_loader.clone()))?;
463− )?;
464
460
465 let _ = Self::launch_language_server(&mut self.language_servers, &mut doc);
461 let _ = Self::launch_language_server(&mut self.language_servers, &mut doc);
466
462