mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 09:26:19 +04:00
Simplify replace dashes with underscore
This commit is contained in:
parent
1789dfabfe
commit
bda4f5c1cd
@ -3,15 +3,7 @@
|
|||||||
use tree_sitter::Language;
|
use tree_sitter::Language;
|
||||||
|
|
||||||
fn replace_dashes_with_underscores(name: &str) -> String {
|
fn replace_dashes_with_underscores(name: &str) -> String {
|
||||||
let mut result = String::with_capacity(name.len());
|
name.replace('-', "_")
|
||||||
for c in name.chars() {
|
|
||||||
if c == '-' {
|
|
||||||
result.push('_');
|
|
||||||
} else {
|
|
||||||
result.push(c);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
result
|
|
||||||
}
|
}
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
const DYLIB_EXTENSION: &str = "so";
|
const DYLIB_EXTENSION: &str = "so";
|
||||||
|
Loading…
Reference in New Issue
Block a user