From 2e6c4a5f92c64b64954974c4239c8599d0ffca10 Mon Sep 17 00:00:00 2001 From: bugarela Date: Thu, 13 Jun 2024 15:40:02 -0300 Subject: [PATCH] Fix capture group issue --- src/state_extraction.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/state_extraction.rs b/src/state_extraction.rs index fb22359..58925d6 100644 --- a/src/state_extraction.rs +++ b/src/state_extraction.rs @@ -29,7 +29,7 @@ impl Translatable for rustc_middle::ty::Ty<'_> { // The following regex replacement has the goal of transforming it into type let re = Regex::new(r"(\w+::)*(\w+)(<(\w+::)*(\w+)>)?").unwrap(); let name = re.replace(name_core.as_str(), |caps: ®ex::Captures| { - if let Some(m) = caps.get(4) { + if let Some(m) = caps.get(5) { format!("{}[{}]", &caps[2], m.as_str()) } else { caps[2].to_string()