summaryrefslogtreecommitdiff
path: root/rust/kernel/str.rs
diff options
context:
space:
mode:
authorAndreas Hindborg <a.hindborg@kernel.org>2025-09-24 14:39:25 +0200
committerDaniel Gomez <da.gomez@kernel.org>2025-11-03 14:40:45 +0100
commit51d9ee90ea9060be240830eb28f5f117ad00318c (patch)
tree4df0d25a2b16c2b716dd830d79c1cdac5b9d104e /rust/kernel/str.rs
parent821fe7bf16c57d690f4f92997f4e51abb93e0347 (diff)
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 <benno.lossin@proton.me> Tested-by: Daniel Gomez <da.gomez@samsung.com> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Benno Lossin <lossin@kernel.org> Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org> Signed-off-by: Daniel Gomez <da.gomez@kernel.org>
Diffstat (limited to 'rust/kernel/str.rs')
-rw-r--r--rust/kernel/str.rs2
1 files changed, 2 insertions, 0 deletions
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]);