Unnamed repository; edit this file 'description' to name the repository.
Auto merge of #137995 - hkBst:parse_format_reuse_unescape, r=nnethercote
Remove duplicate impl of string unescape from parse_format
r? `@nnethercote`
| -rw-r--r-- | crates/hir-def/src/expr_store/lower/asm.rs | 2 | ||||
| -rw-r--r-- | crates/hir-def/src/hir/format_args.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/crates/hir-def/src/expr_store/lower/asm.rs b/crates/hir-def/src/expr_store/lower/asm.rs index 9ef0306565..d36e5205c7 100644 --- a/crates/hir-def/src/expr_store/lower/asm.rs +++ b/crates/hir-def/src/expr_store/lower/asm.rs @@ -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(), diff --git a/crates/hir-def/src/hir/format_args.rs b/crates/hir-def/src/hir/format_args.rs index 2fd21bb0ed..f27a4062a6 100644 --- a/crates/hir-def/src/hir/format_args.rs +++ b/crates/hir-def/src/hir/format_args.rs @@ -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); |