From 51d9ee90ea9060be240830eb28f5f117ad00318c Mon Sep 17 00:00:00 2001 From: Andreas Hindborg Date: Wed, 24 Sep 2025 14:39:25 +0200 Subject: rust: str: add radix prefixed integer parsing functions Add the trait `ParseInt` for parsing string representations of integers where the string representations are optionally prefixed by a radix specifier. Implement the trait for the primitive integer types. Suggested-by: Benno Lossin Tested-by: Daniel Gomez Reviewed-by: Greg Kroah-Hartman Reviewed-by: Benno Lossin Signed-off-by: Andreas Hindborg Signed-off-by: Daniel Gomez --- rust/kernel/str.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'rust/kernel/str.rs') diff --git a/rust/kernel/str.rs b/rust/kernel/str.rs index 5c74e5f77601..a1a3581eb546 100644 --- a/rust/kernel/str.rs +++ b/rust/kernel/str.rs @@ -13,6 +13,8 @@ use core::{ ops::{self, Deref, DerefMut, Index}, }; +pub mod parse_int; + /// Byte string without UTF-8 validity guarantee. #[repr(transparent)] pub struct BStr([u8]); -- cgit