mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 11:20:54 +00:00
Auto merge of #137995 - hkBst:parse_format_reuse_unescape, r=nnethercote
Remove duplicate impl of string unescape from parse_format r? `@nnethercote`
This commit is contained in:
commit
24390f60d6
@ -224,7 +224,7 @@ impl ExprCollector<'_> {
|
||||
|
||||
curarg = parser.curarg;
|
||||
|
||||
let to_span = |inner_span: rustc_parse_format::InnerSpan| {
|
||||
let to_span = |inner_span: std::ops::Range<usize>| {
|
||||
is_direct_literal.then(|| {
|
||||
TextRange::new(
|
||||
inner_span.start.try_into().unwrap(),
|
||||
|
@ -214,7 +214,7 @@ pub(crate) fn parse(
|
||||
};
|
||||
}
|
||||
|
||||
let to_span = |inner_span: parse::InnerSpan| {
|
||||
let to_span = |inner_span: std::ops::Range<usize>| {
|
||||
is_source_literal.then(|| {
|
||||
TextRange::new(inner_span.start.try_into().unwrap(), inner_span.end.try_into().unwrap())
|
||||
})
|
||||
@ -297,7 +297,7 @@ pub(crate) fn parse(
|
||||
unfinished_literal.clear();
|
||||
}
|
||||
|
||||
let span = parser.arg_places.get(placeholder_index).and_then(|&s| to_span(s));
|
||||
let span = parser.arg_places.get(placeholder_index).and_then(|s| to_span(s.clone()));
|
||||
placeholder_index += 1;
|
||||
|
||||
let position_span = to_span(position_span);
|
||||
|
Loading…
x
Reference in New Issue
Block a user