File tree 1 file changed +12
-6
lines changed
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 {
273
273
/// Basic usage:
274
274
///
275
275
/// ```
276
- /// let n = 0x0123456789ABCDEFi64 ;
277
- /// let m = -0x1032547698BADCFFi64 ;
276
+ /// let n: i16 = 0b0000000_01010101 ;
277
+ /// assert_eq!(n, 85) ;
278
278
///
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);
280
283
/// ```
281
284
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
282
285
#[ inline]
@@ -1466,10 +1469,13 @@ macro_rules! uint_impl {
1466
1469
/// Basic usage:
1467
1470
///
1468
1471
/// ```
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();
1471
1476
///
1472
- /// assert_eq!(n.swap_bytes(), m);
1477
+ /// assert_eq!(m, 0b01010101_00000000);
1478
+ /// assert_eq!(m, 21760);
1473
1479
/// ```
1474
1480
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1475
1481
#[ inline]
You can’t perform that action at this time.
0 commit comments