From 87a6d4e73615e17559b99afa065799a38fe6c39e Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Wed, 24 Feb 2021 16:07:39 +0900 Subject: minor: Simplify some code. --- helix-view/src/document.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'helix-view/src/document.rs') diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs index 569e72ee..3f3f620f 100644 --- a/helix-view/src/document.rs +++ b/helix-view/src/document.rs @@ -140,10 +140,12 @@ impl Document { // TODO: this ties lsp support to tree-sitter enabled languages for now. Language // config should use Option to let us have non-tree-sitter configs. - let highlight_config = language_config.highlight_config(scopes).unwrap().unwrap(); + let highlight_config = language_config + .highlight_config(scopes) + .expect("No highlight_config found!"); // TODO: config.configure(scopes) is now delayed, is that ok? - let syntax = Syntax::new(&self.state.doc, highlight_config.clone()); + let syntax = Syntax::new(&self.state.doc, highlight_config); self.syntax = Some(syntax); } else { -- cgit v1.2.3-70-g09d2