parent
33b2868473
commit
c245933369
@ -1,115 +0,0 @@
|
|||||||
From c25f0f9db85c3de547053db8a36e208930c836e0 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andrew Gallant <jamslam@gmail.com>
|
|
||||||
Date: Mon, 4 Mar 2019 16:20:42 -0500
|
|
||||||
Subject: [PATCH] doc: fix overflowing literals in doc tests
|
|
||||||
|
|
||||||
These were likely a result of copy & pasting example code. There is
|
|
||||||
actually an overflowing literal lint that would normally catch this, but
|
|
||||||
doc tests do not need to output lint warnings by default.
|
|
||||||
|
|
||||||
Rust 2018 made overflowing literals deny-by-default, and Rust 2015 just
|
|
||||||
recently did the same---even though it's a breaking change. That in turn
|
|
||||||
caused the doc tests to fail, and thus, we finally noticed it.
|
|
||||||
|
|
||||||
Fixes #144
|
|
||||||
---
|
|
||||||
src/lib.rs | 26 +++++++++++++-------------
|
|
||||||
1 file changed, 13 insertions(+), 13 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/lib.rs b/src/lib.rs
|
|
||||||
index 497e914..0274d74 100644
|
|
||||||
--- a/src/lib.rs
|
|
||||||
+++ b/src/lib.rs
|
|
||||||
@@ -200,8 +200,8 @@ mod private {
|
|
||||||
/// use byteorder::{ByteOrder, BigEndian};
|
|
||||||
///
|
|
||||||
/// let mut buf = [0; 2];
|
|
||||||
-/// BigEndian::write_i16(&mut buf, -50_000);
|
|
||||||
-/// assert_eq!(-50_000, BigEndian::read_i16(&buf));
|
|
||||||
+/// BigEndian::write_i16(&mut buf, -5_000);
|
|
||||||
+/// assert_eq!(-5_000, BigEndian::read_i16(&buf));
|
|
||||||
/// ```
|
|
||||||
///
|
|
||||||
/// [`BigEndian`]: enum.BigEndian.html
|
|
||||||
@@ -372,8 +372,8 @@ pub trait ByteOrder
|
|
||||||
/// use byteorder::{ByteOrder, LittleEndian};
|
|
||||||
///
|
|
||||||
/// let mut buf = [0; 2];
|
|
||||||
- /// LittleEndian::write_u16(&mut buf, 1_000_000);
|
|
||||||
- /// assert_eq!(1_000_000, LittleEndian::read_u16(&buf));
|
|
||||||
+ /// LittleEndian::write_u16(&mut buf, 1_000);
|
|
||||||
+ /// assert_eq!(1_000, LittleEndian::read_u16(&buf));
|
|
||||||
/// ```
|
|
||||||
fn write_u16(buf: &mut [u8], n: u16);
|
|
||||||
|
|
||||||
@@ -1079,7 +1079,7 @@ pub trait ByteOrder
|
|
||||||
/// use byteorder::{ByteOrder, LittleEndian};
|
|
||||||
///
|
|
||||||
/// let mut bytes = [0; 8];
|
|
||||||
- /// let numbers_given = [1, 2, 0xf00f, 0xffee];
|
|
||||||
+ /// let numbers_given = [1, 2, 0x0f, 0xee];
|
|
||||||
/// LittleEndian::write_i16_into(&numbers_given, &mut bytes);
|
|
||||||
///
|
|
||||||
/// let mut numbers_got = [0; 4];
|
|
||||||
@@ -1258,7 +1258,7 @@ pub trait ByteOrder
|
|
||||||
/// use byteorder::{ByteOrder, LittleEndian};
|
|
||||||
///
|
|
||||||
/// let mut bytes = [0; 32];
|
|
||||||
- /// let numbers_given = [1.0, 2.0, 31.312e311, -11.32e91];
|
|
||||||
+ /// let numbers_given = [1.0, 2.0, 31.312e211, -11.32e91];
|
|
||||||
/// LittleEndian::write_f64_into(&numbers_given, &mut bytes);
|
|
||||||
///
|
|
||||||
/// let mut numbers_got = [0.0; 4];
|
|
||||||
@@ -1292,7 +1292,7 @@ pub trait ByteOrder
|
|
||||||
/// use byteorder::{ByteOrder, LittleEndian};
|
|
||||||
///
|
|
||||||
/// let mut bytes = [0; 32];
|
|
||||||
- /// let numbers_given = [1.0, 2.0, 31.312e311, -11.32e91];
|
|
||||||
+ /// let numbers_given = [1.0, 2.0, 31.312e211, -11.32e91];
|
|
||||||
/// LittleEndian::write_f64_into(&numbers_given, &mut bytes);
|
|
||||||
///
|
|
||||||
/// let mut numbers_got = [0.0; 4];
|
|
||||||
@@ -1412,7 +1412,7 @@ pub trait ByteOrder
|
|
||||||
/// use byteorder::{ByteOrder, LittleEndian};
|
|
||||||
///
|
|
||||||
/// let mut bytes = [0; 8];
|
|
||||||
- /// let numbers_given = [1, 2, 0xf00f, 0xffee];
|
|
||||||
+ /// let numbers_given = [1, 2, 0x0f, 0xee];
|
|
||||||
/// LittleEndian::write_i16_into(&numbers_given, &mut bytes);
|
|
||||||
///
|
|
||||||
/// let mut numbers_got = [0; 4];
|
|
||||||
@@ -1557,7 +1557,7 @@ pub trait ByteOrder
|
|
||||||
/// use byteorder::{ByteOrder, LittleEndian};
|
|
||||||
///
|
|
||||||
/// let mut bytes = [0; 32];
|
|
||||||
- /// let numbers_given = [1.0, 2.0, 31.312e311, -11.32e91];
|
|
||||||
+ /// let numbers_given = [1.0, 2.0, 31.312e211, -11.32e91];
|
|
||||||
/// LittleEndian::write_f64_into(&numbers_given, &mut bytes);
|
|
||||||
///
|
|
||||||
/// let mut numbers_got = [0.0; 4];
|
|
||||||
@@ -1663,9 +1663,9 @@ pub trait ByteOrder
|
|
||||||
/// ```rust
|
|
||||||
/// use byteorder::{ByteOrder, BigEndian};
|
|
||||||
///
|
|
||||||
- /// let mut numbers = [5, 65000];
|
|
||||||
+ /// let mut numbers = [5, 6500];
|
|
||||||
/// BigEndian::from_slice_i16(&mut numbers);
|
|
||||||
- /// assert_eq!(numbers, [5i16.to_be(), 65000i16.to_be()]);
|
|
||||||
+ /// assert_eq!(numbers, [5i16.to_be(), 6500i16.to_be()]);
|
|
||||||
/// ```
|
|
||||||
#[inline]
|
|
||||||
fn from_slice_i16(src: &mut [i16]) {
|
|
||||||
@@ -1845,8 +1845,8 @@ pub type LE = LittleEndian;
|
|
||||||
/// use byteorder::{ByteOrder, NetworkEndian, BigEndian};
|
|
||||||
///
|
|
||||||
/// let mut buf = [0; 2];
|
|
||||||
-/// BigEndian::write_i16(&mut buf, -50_000);
|
|
||||||
-/// assert_eq!(-50_000, NetworkEndian::read_i16(&buf));
|
|
||||||
+/// BigEndian::write_i16(&mut buf, -5_000);
|
|
||||||
+/// assert_eq!(-5_000, NetworkEndian::read_i16(&buf));
|
|
||||||
/// ```
|
|
||||||
///
|
|
||||||
/// [`BigEndian`]: enum.BigEndian.html
|
|
||||||
--
|
|
||||||
2.22.0.rc3
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
|||||||
--- byteorder-1.3.2/Cargo.toml 1970-01-01T00:00:00+00:00
|
|
||||||
+++ byteorder-1.3.2/Cargo.toml 2019-09-14T16:01:59.721513+00:00
|
|
||||||
@@ -34,11 +34,11 @@
|
|
||||||
version = "0.3"
|
|
||||||
|
|
||||||
[dev-dependencies.quickcheck]
|
|
||||||
-version = "0.8"
|
|
||||||
+version = "0.9"
|
|
||||||
default-features = false
|
|
||||||
|
|
||||||
[dev-dependencies.rand]
|
|
||||||
-version = "0.6"
|
|
||||||
+version = "0.7"
|
|
||||||
|
|
||||||
[features]
|
|
||||||
default = ["std"]
|
|
@ -1 +1 @@
|
|||||||
SHA512 (byteorder-1.3.4.crate) = 0618ce2cd6f3f6c586201d9aee8c8aaa08f99c9f9f215cf448b3cb6af1ac741845f5279953544caaec7fcf0beec1474bb991bee1ad0c0dac0c3f1d3ddd99e2d9
|
SHA512 (byteorder-1.4.3.crate) = 8c8000eb8ecf40351c9ce36a3a8acd7a02f81786d1b11aab85adfeffa0f2267ed74df29b2ca5d1d38128484d1d3cad2b673aa0d0441dcd0620dfd3934bb888fa
|
||||||
|
Loading…
Reference in new issue