Skip to content

Commit e3d8ef8

Browse files
authored
Merge pull request #1843 from erikdesjardins/normal
Improve symbol name normalization
2 parents b28fea9 + 7482c54 commit e3d8ef8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

collector/src/artifact_stats.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static RUSTC_HASH_REGEX: OnceLock<Regex> = OnceLock::new();
9595

9696
/// Demangle the symbol and remove rustc mangling hashes.
9797
fn normalize_symbol_name(symbol: &str) -> String {
98-
let regex = RUSTC_HASH_REGEX.get_or_init(|| Regex::new(r#"[a-z0-9]{15,16}"#).unwrap());
98+
let regex = RUSTC_HASH_REGEX.get_or_init(|| Regex::new(r#"(::)?\b[a-z0-9]{15,17}\b"#).unwrap());
9999

100100
let symbol = rustc_demangle::demangle(symbol).to_string();
101101
regex.replace_all(&symbol, "").to_string()

0 commit comments

Comments
 (0)