about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJohann Hemmann <johann.hemmann@code.berlin>2024-01-22 01:19:50 +0100
committerJohann Hemmann <johann.hemmann@code.berlin>2024-01-31 19:06:18 +0100
commitf191b807990cce67a7662254127e9b6adb030d8d (patch)
tree23b450040a16a3e6e1be7c88d783e468598bc165
parentc4302eaa566eb74083c4233a56788d32f147a88d (diff)
downloadrust-f191b807990cce67a7662254127e9b6adb030d8d.tar.gz
rust-f191b807990cce67a7662254127e9b6adb030d8d.zip
Refactor
-rw-r--r--crates/hir-def/src/hir/format_args.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/hir-def/src/hir/format_args.rs b/crates/hir-def/src/hir/format_args.rs
index dc09b0ef3ec..22864b32894 100644
--- a/crates/hir-def/src/hir/format_args.rs
+++ b/crates/hir-def/src/hir/format_args.rs
@@ -178,9 +178,9 @@ pub(crate) fn parse(
     let text = s.text_without_quotes();
     let str_style = match s.quote_offsets() {
         Some(offsets) => {
-            let raw = u32::from(offsets.quotes.0.len()) - 1;
+            let raw = usize::from(offsets.quotes.0.len()) - 1;
             // subtract 1 for the `r` prefix
-            (raw != 0).then(|| raw as usize - 1)
+            (raw != 0).then(|| raw - 1)
         }
         None => None,
     };