Simplify replace dashes with underscore

pull/494/head
Ivan Tham 3 years ago committed by Blaž Hrastnik
parent 1789dfabfe
commit bda4f5c1cd

@ -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";

Loading…
Cancel
Save