diff --git a/starlark_lsp/src/definition.rs b/starlark_lsp/src/definition.rs index 3117389da..a65f80462 100644 --- a/starlark_lsp/src/definition.rs +++ b/starlark_lsp/src/definition.rs @@ -658,7 +658,7 @@ pub(crate) mod helpers { let mut fixture_idx = 0; for matches in re.captures_iter(fixture) { - let full_tag = matches.get(0).unwrap(); + let full_tag = matches.get_match(); let is_end_tag = matches.get(1).is_some(); let identifier = matches.get(2).unwrap().as_str().to_owned(); diff --git a/starlark_lsp/src/test.rs b/starlark_lsp/src/test.rs index a76f5166c..a4931a574 100644 --- a/starlark_lsp/src/test.rs +++ b/starlark_lsp/src/test.rs @@ -235,10 +235,7 @@ impl LspContext for TestServerContext { let start_pos = cap.get(1).unwrap().as_str().parse().unwrap(); let end_pos = cap.get(2).unwrap().as_str().parse().unwrap(); let span = Span::new(Pos::new(start_pos), Pos::new(end_pos)); - ( - literal[0..cap.get(0).unwrap().start()].to_owned(), - Some(span), - ) + (literal[0..cap.get_match().start()].to_owned(), Some(span)) } None => (literal.to_owned(), None), };