on master help sign in
cargo fmt + clippy lint
commit4080341977d10abe91808711a3d5c2bc726c10e1 authorBlaž Hrastnik <blaz@mxxn.io> dateSun 23 Jan 2022, 16:15 (5 years ago) parent7c9ebd0
3 files changed+4−14
helix-core/src/syntax.rs+2−4 helix-view/src/document.rs+1−5 helix-view/src/editor.rs+1−5
helix-core/src/syntax.rs+2−4
@@ -436,7 +436,7 @@ impl Syntax {
436436 };
437437
438438 syntax
439− .update(source, source, &ChangeSet::new(&source))
439+ .update(source, source, &ChangeSet::new(source))
440440 .unwrap();
441441
442442 syntax
@@ -735,9 +735,7 @@ impl Syntax {
735735 .peekable();
736736
737737 // If there's no captures, skip the layer
738− if captures.peek().is_none() {
739− return None;
740− }
738+ captures.peek()?;
741739
742740 Some(HighlightIterLayer {
743741 highlight_end_stack: Vec::new(),
helix-view/src/document.rs+1−5
@@ -594,11 +594,7 @@ impl Document {
594594
595595 /// Set the programming language for the file if you know the name (scope) but don't have the
596596 /// [`syntax::LanguageConfiguration`] for it.
597− pub fn set_language2(
598− &mut self,
599− scope: &str,
600− config_loader: Arc<syntax::Loader>,
601− ) {
597+ pub fn set_language2(&mut self, scope: &str, config_loader: Arc<syntax::Loader>) {
602598 let language_config = config_loader.language_config_for_scope(scope);
603599
604600 self.set_language(language_config, Some(config_loader));
helix-view/src/editor.rs+1−5
@@ -456,11 +456,7 @@ impl Editor {
456456 let id = if let Some(id) = id {
457457 id
458458 } else {
459− let mut doc = Document::open(
460− &path,
461− None,
462− Some(self.syn_loader.clone()),
463− )?;
459+ let mut doc = Document::open(&path, None, Some(self.syn_loader.clone()))?;
464460
465461 let _ = Self::launch_language_server(&mut self.language_servers, &mut doc);
466462