From 3feb00283df92b8865c9cf7baba0e2ab06dcc028 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Tue, 29 Sep 2020 18:02:27 +0900 Subject: clippy warnings --- helix-core/src/syntax.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'helix-core/src/syntax.rs') diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs index 3d85ff25..638ec8ee 100644 --- a/helix-core/src/syntax.rs +++ b/helix-core/src/syntax.rs @@ -37,11 +37,11 @@ impl LanguageConfiguration { let highlights_query = std::fs::read_to_string(self.path.join("queries/highlights.scm")) - .unwrap_or(String::new()); + .unwrap_or_default(); let injections_query = std::fs::read_to_string(self.path.join("queries/injections.scm")) - .unwrap_or(String::new()); + .unwrap_or_default(); let locals_query = ""; @@ -66,7 +66,7 @@ impl LanguageConfiguration { use once_cell::sync::Lazy; -pub(crate) static LOADER: Lazy = Lazy::new(|| Loader::init()); +pub(crate) static LOADER: Lazy = Lazy::new(Loader::init); pub struct Loader { // highlight_names ? @@ -159,7 +159,7 @@ impl Syntax { // let grammar = get_language(&language); let parser = Parser::new(); - let root_layer = LanguageLayer::new(); + let root_layer = LanguageLayer { tree: None }; // track markers of injections // track scope_descriptor: a Vec of scopes for item in tree @@ -317,9 +317,9 @@ use crate::transaction::{ChangeSet, Operation}; use crate::Tendril; impl LanguageLayer { - pub fn new() -> Self { - Self { tree: None } - } + // pub fn new() -> Self { + // Self { tree: None } + // } fn tree(&self) -> &Tree { // TODO: no unwrap -- cgit v1.2.3-70-g09d2