diff --git a/tokio-console/src/state/mod.rs b/tokio-console/src/state/mod.rs index 48fd2d576..affffdd5c 100644 --- a/tokio-console/src/state/mod.rs +++ b/tokio-console/src/state/mod.rs @@ -511,10 +511,8 @@ fn truncate_registry_path(s: String) -> String { static REGEX: OnceCell = OnceCell::new(); let regex = REGEX.get_or_init(|| { - Regex::new( - r".*(/|\\)\.cargo(/|\\)(registry(/|\\)src(/|\\)[^/\\]*(/|\\)|git(/|\\)checkouts(/|\\))", - ) - .expect("failed to compile regex") + Regex::new(r".*[/\\]\.cargo[/\\](registry[/\\]src[/\\][^/\\]*[/\\]|git[/\\]checkouts[/\\])") + .expect("failed to compile regex") }); let s = match regex.replace(&s, "/") {