aboutsummaryrefslogtreecommitdiff
path: root/helix-loader/src/grammar.rs
diff options
context:
space:
mode:
authorMarcin Puc2022-03-30 00:08:30 +0000
committerGitHub2022-03-30 00:08:30 +0000
commitf2dd3d446914ec0953cd7e056d430fc3b959e75d (patch)
tree4fb839ec2a389bbdca4e64931de8516db010c6a4 /helix-loader/src/grammar.rs
parentc8082a113321455cd1025a115e8da72eca37e320 (diff)
Avoid using the format ident Rust feature (#1881)
Diffstat (limited to 'helix-loader/src/grammar.rs')
-rw-r--r--helix-loader/src/grammar.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/helix-loader/src/grammar.rs b/helix-loader/src/grammar.rs
index 299a06bf..f0c5ea28 100644
--- a/helix-loader/src/grammar.rs
+++ b/helix-loader/src/grammar.rs
@@ -63,12 +63,12 @@ pub fn get_language(name: &str) -> Result<Language> {
library_path.set_extension(DYLIB_EXTENSION);
let library = unsafe { Library::new(&library_path) }
- .with_context(|| format!("Error opening dynamic library {library_path:?}"))?;
+ .with_context(|| format!("Error opening dynamic library {:?}", library_path))?;
let language_fn_name = format!("tree_sitter_{}", name.replace('-', "_"));
let language = unsafe {
let language_fn: Symbol<unsafe extern "C" fn() -> Language> = library
.get(language_fn_name.as_bytes())
- .with_context(|| format!("Failed to load symbol {language_fn_name}"))?;
+ .with_context(|| format!("Failed to load symbol {}", language_fn_name))?;
language_fn()
};
std::mem::forget(library);
@@ -133,7 +133,7 @@ where
// TODO: print all failures instead of the first one found.
rx.iter()
.find(|result| result.is_err())
- .map(|err| err.with_context(|| format!("Failed to {action} some grammar(s)")))
+ .map(|err| err.with_context(|| format!("Failed to {} some grammar(s)", action)))
.unwrap_or(Ok(()))
}
@@ -238,12 +238,16 @@ fn build_grammar(grammar: GrammarConfiguration) -> Result<()> {
};
let grammar_dir_entries = grammar_dir.read_dir().with_context(|| {
- format!("Failed to read directory {grammar_dir:?}. Did you use 'hx --grammar fetch'?")
+ format!(
+ "Failed to read directory {:?}. Did you use 'hx --grammar fetch'?",
+ grammar_dir
+ )
})?;
if grammar_dir_entries.count() == 0 {
return Err(anyhow!(
- "Directory {grammar_dir:?} is empty. Did you use 'hx --grammar fetch'?"
+ "Directory {:?} is empty. Did you use 'hx --grammar fetch'?",
+ grammar_dir
));
};