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> {
6060 /// method**. This means `N` does not need to match the type suffix!
6161 ///
6262 /// 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).
6370 pub fn value < N : FromIntegerLiteral > ( & self ) -> Option < N > {
6471 let base = N :: from_small_number ( self . base . value ( ) ) ;
6572
You can’t perform that action at this time.
0 commit comments