File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
crates/toml/src/de/parser Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -35,9 +35,19 @@ impl DeInteger<'_> {
3535 i128:: from_str_radix ( self . inner . as_ref ( ) , self . radix ) . ok ( )
3636 }
3737
38- pub ( crate ) fn as_str ( & self ) -> & str {
38+ /// [`from_str_radix`][i64::from_str_radix]-compatible representation of an integer
39+ ///
40+ /// Requires [`DeInteger::radix`] to interpret
41+ ///
42+ /// See [`Display`][std::fmt::Display] for a representation that includes the radix
43+ pub fn as_str ( & self ) -> & str {
3944 self . inner . as_ref ( )
4045 }
46+
47+ /// Numeric base of [`DeInteger::as_str`]
48+ pub fn radix ( & self ) -> u32 {
49+ self . radix
50+ }
4151}
4252
4353impl Default for DeInteger < ' _ > {
@@ -84,7 +94,8 @@ impl DeFloat<'_> {
8494 }
8595 }
8696
87- pub ( crate ) fn as_str ( & self ) -> & str {
97+ /// [`FromStr`][std::str::FromStr]-compatible representation of a float
98+ pub fn as_str ( & self ) -> & str {
8899 self . inner . as_ref ( )
89100 }
90101}
You can’t perform that action at this time.
0 commit comments