File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,13 @@ impl<B: Buffer> IntegerLit<B> {
60
60
/// method**. This means `N` does not need to match the type suffix!
61
61
///
62
62
/// Returns `None` if the literal overflows `N`.
63
+ ///
64
+ /// Hint: `u128` can represent all possible values integer literal values,
65
+ /// as there are no negative literals (see type docs). Thus you can, for
66
+ /// example, safely use `lit.value::<u128>().to_string()` to get a decimal
67
+ /// string. (Technically, Rust integer literals can represent arbitrarily
68
+ /// large numbers, but those would be rejected at a later stage by the Rust
69
+ /// compiler).
63
70
pub fn value < N : FromIntegerLiteral > ( & self ) -> Option < N > {
64
71
let base = N :: from_small_number ( self . base . value ( ) ) ;
65
72
You can’t perform that action at this time.
0 commit comments