From cf65bf035f81e4a37f21752cc0640387b291b908 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Tue, 2 Apr 2024 09:46:21 +1100 Subject: [PATCH] Introduce local variable To make the stripping of the prefix a little clearer introduce a local variable. Refactor only, no logic changes. --- units/src/parse.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/units/src/parse.rs b/units/src/parse.rs index 9ace652f..ff5e64bd 100644 --- a/units/src/parse.rs +++ b/units/src/parse.rs @@ -92,7 +92,8 @@ pub fn int + Into>(s: S) -> Result + Into>(s: S) -> Result { - u32::from_str_radix(strip_hex_prefix(s.as_ref()), 16).map_err(|error| ParseIntError { + let stripped = strip_hex_prefix(s.as_ref()); + u32::from_str_radix(stripped, 16).map_err(|error| ParseIntError { input: s.into(), bits: 32, is_signed: false,