diff --git a/helix-syntax/src/lib.rs b/helix-syntax/src/lib.rs index b6c0ecf3..b0ec48d8 100644 --- a/helix-syntax/src/lib.rs +++ b/helix-syntax/src/lib.rs @@ -3,15 +3,7 @@ use libloading::{Library, Symbol}; use tree_sitter::Language; fn replace_dashes_with_underscores(name: &str) -> String { - let mut result = String::with_capacity(name.len()); - for c in name.chars() { - if c == '-' { - result.push('_'); - } else { - result.push(c); - } - } - result + name.replace('-', "_") } #[cfg(unix)] const DYLIB_EXTENSION: &str = "so";