@@ -63,12 +63,12 @@ pub fn get_language(name: &str) -> Result<Language> {
63 library_path.set_extension(DYLIB_EXTENSION);
63 library_path.set_extension(DYLIB_EXTENSION);
65 let library = unsafe { Library::new(&library_path) }
65 let library = unsafe { Library::new(&library_path) }
66− .with_context(|| format!("Error opening dynamic library {library_path:?}"))?;
66+ .with_context(|| format!("Error opening dynamic library {:?}", library_path))?;
67 let language_fn_name = format!("tree_sitter_{}", name.replace('-', "_"));
67 let language_fn_name = format!("tree_sitter_{}", name.replace('-', "_"));
68 let language = unsafe {
68 let language = unsafe {
69 let language_fn: Symbol<unsafe extern "C" fn() -> Language> = library
69 let language_fn: Symbol<unsafe extern "C" fn() -> Language> = library
70 .get(language_fn_name.as_bytes())
70 .get(language_fn_name.as_bytes())
71− .with_context(|| format!("Failed to load symbol {language_fn_name}"))?;
71+ .with_context(|| format!("Failed to load symbol {}", language_fn_name))?;
72 language_fn()
72 language_fn()
74 std::mem::forget(library);
74 std::mem::forget(library);
@@ -133,7 +133,7 @@ where
133 // TODO: print all failures instead of the first one found.
133 // TODO: print all failures instead of the first one found.
134 rx.iter()
134 rx.iter()
135 .find(|result| result.is_err())
135 .find(|result| result.is_err())
136− .map(|err| err.with_context(|| format!("Failed to {action} some grammar(s)")))
136+ .map(|err| err.with_context(|| format!("Failed to {} some grammar(s)", action)))
137 .unwrap_or(Ok(()))
137 .unwrap_or(Ok(()))
@@ -238,12 +238,16 @@ fn build_grammar(grammar: GrammarConfiguration) -> Result<()> {
240 let grammar_dir_entries = grammar_dir.read_dir().with_context(|| {
240 let grammar_dir_entries = grammar_dir.read_dir().with_context(|| {
241− format!("Failed to read directory {grammar_dir:?}. Did you use 'hx --grammar fetch'?")
242+ "Failed to read directory {:?}. Did you use 'hx --grammar fetch'?",
244 if grammar_dir_entries.count() == 0 {
247 if grammar_dir_entries.count() == 0 {
245 return Err(anyhow!(
248 return Err(anyhow!(
246− "Directory {grammar_dir:?} is empty. Did you use 'hx --grammar fetch'?"
249+ "Directory {:?} is empty. Did you use 'hx --grammar fetch'?",