Skip to content

Commit

Permalink
Fix capture group issue
Browse files Browse the repository at this point in the history
  • Loading branch information
bugarela committed Jun 13, 2024
1 parent 9e4ca7f commit 2e6c4a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/state_extraction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl Translatable for rustc_middle::ty::Ty<'_> {
// The following regex replacement has the goal of transforming it into type<type_arg>
let re = Regex::new(r"(\w+::)*(\w+)(<(\w+::)*(\w+)>)?").unwrap();
let name = re.replace(name_core.as_str(), |caps: &regex::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()
Expand Down

0 comments on commit 2e6c4a5

Please sign in to comment.