File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -273,10 +273,13 @@ macro_rules! int_impl {
273273 /// Basic usage:
274274 ///
275275 /// ```
276- /// let n = 0x0123456789ABCDEFi64 ;
277- /// let m = -0x1032547698BADCFFi64 ;
276+ /// let n: i16 = 0b0000000_01010101 ;
277+ /// assert_eq!(n, 85) ;
278278 ///
279- /// assert_eq!(n.swap_bytes(), m);
279+ /// let m = n.swap_bytes();
280+ ///
281+ /// assert_eq!(m, 0b01010101_00000000);
282+ /// assert_eq!(m, 21760);
280283 /// ```
281284 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
282285 #[ inline]
@@ -1466,10 +1469,13 @@ macro_rules! uint_impl {
14661469 /// Basic usage:
14671470 ///
14681471 /// ```
1469- /// let n = 0x0123456789ABCDEFu64;
1470- /// let m = 0xEFCDAB8967452301u64;
1472+ /// let n: u16 = 0b0000000_01010101;
1473+ /// assert_eq!(n, 85);
1474+ ///
1475+ /// let m = n.swap_bytes();
14711476 ///
1472- /// assert_eq!(n.swap_bytes(), m);
1477+ /// assert_eq!(m, 0b01010101_00000000);
1478+ /// assert_eq!(m, 21760);
14731479 /// ```
14741480 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
14751481 #[ inline]
You can’t perform that action at this time.
0 commit comments