diff -Nru rust-byteorder-1.3.2/build.rs rust-byteorder-1.3.4/build.rs --- rust-byteorder-1.3.2/build.rs 2019-01-22 17:15:45.000000000 +0000 +++ rust-byteorder-1.3.4/build.rs 2020-02-07 13:16:00.000000000 +0000 @@ -1,3 +1,6 @@ +// For the 'try!' macro, until we bump MSRV past 1.12. +#![allow(deprecated)] + use std::env; use std::ffi::OsString; use std::io::{self, Write}; diff -Nru rust-byteorder-1.3.2/Cargo.toml rust-byteorder-1.3.4/Cargo.toml --- rust-byteorder-1.3.2/Cargo.toml 1970-01-01 00:00:00.000000000 +0000 +++ rust-byteorder-1.3.4/Cargo.toml 2020-02-07 13:18:00.000000000 +0000 @@ -12,7 +12,7 @@ [package] name = "byteorder" -version = "1.3.2" +version = "1.3.4" authors = ["Andrew Gallant "] build = "build.rs" exclude = ["/ci/*"] diff -Nru rust-byteorder-1.3.2/Cargo.toml.orig rust-byteorder-1.3.4/Cargo.toml.orig --- rust-byteorder-1.3.2/Cargo.toml.orig 2019-06-09 13:41:09.000000000 +0000 +++ rust-byteorder-1.3.4/Cargo.toml.orig 2020-02-07 13:17:59.000000000 +0000 @@ -1,6 +1,6 @@ [package] name = "byteorder" -version = "1.3.2" #:version +version = "1.3.4" #:version authors = ["Andrew Gallant "] description = "Library for reading/writing numbers in big-endian and little-endian." documentation = "https://docs.rs/byteorder" diff -Nru rust-byteorder-1.3.2/.cargo_vcs_info.json rust-byteorder-1.3.4/.cargo_vcs_info.json --- rust-byteorder-1.3.2/.cargo_vcs_info.json 1970-01-01 00:00:00.000000000 +0000 +++ rust-byteorder-1.3.4/.cargo_vcs_info.json 2020-02-07 13:18:00.000000000 +0000 @@ -1,5 +1,5 @@ { "git": { - "sha1": "058237661a88c2f610f280340310fce19d98d265" + "sha1": "eaaad370715c04d78334d6a5b49c637549c84c71" } } diff -Nru rust-byteorder-1.3.2/debian/changelog rust-byteorder-1.3.4/debian/changelog --- rust-byteorder-1.3.2/debian/changelog 2020-01-25 19:03:30.000000000 +0000 +++ rust-byteorder-1.3.4/debian/changelog 2020-06-16 19:07:15.000000000 +0000 @@ -1,3 +1,9 @@ +rust-byteorder (1.3.4-1) unstable; urgency=medium + + * Package byteorder 1.3.4 from crates.io using debcargo 2.4.3 + + -- Wolfgang Silbermayr Tue, 16 Jun 2020 21:07:15 +0200 + rust-byteorder (1.3.2-2) unstable; urgency=medium * Package byteorder 1.3.2 from crates.io using debcargo 2.4.2 diff -Nru rust-byteorder-1.3.2/debian/control rust-byteorder-1.3.4/debian/control --- rust-byteorder-1.3.2/debian/control 2020-01-25 19:03:30.000000000 +0000 +++ rust-byteorder-1.3.4/debian/control 2020-06-16 19:07:15.000000000 +0000 @@ -32,10 +32,10 @@ librust-byteorder-1.3+default-dev (= ${binary:Version}), librust-byteorder-1.3+i128-dev (= ${binary:Version}), librust-byteorder-1.3+std-dev (= ${binary:Version}), - librust-byteorder-1.3.2-dev (= ${binary:Version}), - librust-byteorder-1.3.2+default-dev (= ${binary:Version}), - librust-byteorder-1.3.2+i128-dev (= ${binary:Version}), - librust-byteorder-1.3.2+std-dev (= ${binary:Version}) + librust-byteorder-1.3.4-dev (= ${binary:Version}), + librust-byteorder-1.3.4+default-dev (= ${binary:Version}), + librust-byteorder-1.3.4+i128-dev (= ${binary:Version}), + librust-byteorder-1.3.4+std-dev (= ${binary:Version}) Description: Reading/writing numbers in big-endian and little-endian - Rust source code This package contains the source for the Rust byteorder crate, packaged by debcargo for use with cargo and dh-cargo. diff -Nru rust-byteorder-1.3.2/debian/tests/control rust-byteorder-1.3.4/debian/tests/control --- rust-byteorder-1.3.2/debian/tests/control 2020-01-25 19:03:30.000000000 +0000 +++ rust-byteorder-1.3.4/debian/tests/control 2020-06-16 19:07:15.000000000 +0000 @@ -1,9 +1,9 @@ -Test-Command: /usr/share/cargo/bin/cargo-auto-test byteorder 1.3.2 --all-targets --all-features +Test-Command: /usr/share/cargo/bin/cargo-auto-test byteorder 1.3.4 --all-targets --all-features Features: test-name=@ Depends: dh-cargo (>= 18), librust-doc-comment-0.3+default-dev, librust-quickcheck-0.9-dev | librust-quickcheck-0.8-dev, librust-rand-0.7+default-dev | librust-rand-0.6+default-dev, @ Restrictions: allow-stderr, skip-not-installable -Test-Command: /usr/share/cargo/bin/cargo-auto-test byteorder 1.3.2 --all-targets --no-default-features +Test-Command: /usr/share/cargo/bin/cargo-auto-test byteorder 1.3.4 --all-targets --no-default-features Features: test-name=librust-byteorder-dev Depends: dh-cargo (>= 18), librust-doc-comment-0.3+default-dev, librust-quickcheck-0.9-dev | librust-quickcheck-0.8-dev, librust-rand-0.7+default-dev | librust-rand-0.6+default-dev, @ Restrictions: allow-stderr, skip-not-installable diff -Nru rust-byteorder-1.3.2/src/lib.rs rust-byteorder-1.3.4/src/lib.rs --- rust-byteorder-1.3.2/src/lib.rs 2019-06-09 13:40:43.000000000 +0000 +++ rust-byteorder-1.3.4/src/lib.rs 2020-02-07 13:17:07.000000000 +0000 @@ -67,6 +67,9 @@ [`Write`]: https://doc.rust-lang.org/std/io/trait.Write.html */ +// For the 'try!' macro, until we bump MSRV past 1.12. +#![allow(deprecated)] + #![deny(missing_docs)] #![cfg_attr(not(feature = "std"), no_std)] @@ -1411,6 +1414,40 @@ #[cfg(byteorder_i128)] fn write_u128_into(src: &[u128], dst: &mut [u8]); + /// Writes signed 8 bit integers from `src` into `dst`. + /// + /// Note that since each `i8` is a single byte, no byte order conversions + /// are used. This method is included because it provides a safe, simple + /// way for the caller to write from a `&[i8]` buffer. (Without this + /// method, the caller would have to either use `unsafe` code or convert + /// each byte to `u8` individually.) + /// + /// # Panics + /// + /// Panics when `buf.len() != src.len()`. + /// + /// # Examples + /// + /// Write and read `i8` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian, ReadBytesExt}; + /// + /// let mut bytes = [0; 4]; + /// let numbers_given = [1, 2, 0xf, 0xe]; + /// LittleEndian::write_i8_into(&numbers_given, &mut bytes); + /// + /// let mut numbers_got = [0; 4]; + /// bytes.as_ref().read_i8_into(&mut numbers_got); + /// assert_eq!(numbers_given, numbers_got); + /// ``` + fn write_i8_into(src: &[i8], dst: &mut [u8]) { + let src = unsafe { + slice::from_raw_parts(src.as_ptr() as *const u8, src.len()) + }; + dst.copy_from_slice(src); + } + /// Writes signed 16 bit integers from `src` into `dst`. /// /// # Panics @@ -1979,26 +2016,26 @@ #[inline] fn read_uint(buf: &[u8], nbytes: usize) -> u64 { assert!(1 <= nbytes && nbytes <= 8 && nbytes <= buf.len()); - let mut out = [0u8; 8]; - let ptr_out = out.as_mut_ptr(); + let mut out = 0u64; + let ptr_out = &mut out as *mut u64 as *mut u8; unsafe { copy_nonoverlapping( buf.as_ptr(), ptr_out.offset((8 - nbytes) as isize), nbytes); - (*(ptr_out as *const u64)).to_be() } + out.to_be() } #[cfg(byteorder_i128)] #[inline] fn read_uint128(buf: &[u8], nbytes: usize) -> u128 { assert!(1 <= nbytes && nbytes <= 16 && nbytes <= buf.len()); - let mut out = [0u8; 16]; - let ptr_out = out.as_mut_ptr(); + let mut out: u128 = 0; + let ptr_out = &mut out as *mut u128 as *mut u8; unsafe { copy_nonoverlapping( buf.as_ptr(), ptr_out.offset((16 - nbytes) as isize), nbytes); - (*(ptr_out as *const u128)).to_be() } + out.to_be() } #[inline] @@ -2194,24 +2231,24 @@ #[inline] fn read_uint(buf: &[u8], nbytes: usize) -> u64 { assert!(1 <= nbytes && nbytes <= 8 && nbytes <= buf.len()); - let mut out = [0u8; 8]; - let ptr_out = out.as_mut_ptr(); + let mut out = 0u64; + let ptr_out = &mut out as *mut u64 as *mut u8; unsafe { copy_nonoverlapping(buf.as_ptr(), ptr_out, nbytes); - (*(ptr_out as *const u64)).to_le() } + out.to_le() } #[cfg(byteorder_i128)] #[inline] fn read_uint128(buf: &[u8], nbytes: usize) -> u128 { assert!(1 <= nbytes && nbytes <= 16 && nbytes <= buf.len()); - let mut out = [0u8; 16]; - let ptr_out = out.as_mut_ptr(); + let mut out: u128 = 0; + let ptr_out = &mut out as *mut u128 as *mut u8; unsafe { copy_nonoverlapping(buf.as_ptr(), ptr_out, nbytes); - (*(ptr_out as *const u128)).to_le() } + out.to_le() } #[inline] @@ -2461,7 +2498,7 @@ fn prop(n: $ty_int) -> bool { let mut buf = [0; 16]; BigEndian::$write(&mut buf, n.clone(), $bytes); - n == BigEndian::$read(&mut buf[..$bytes], $bytes) + n == BigEndian::$read(&buf[..$bytes], $bytes) } qc_sized(prop as fn($ty_int) -> bool, $max); } @@ -2471,7 +2508,7 @@ fn prop(n: $ty_int) -> bool { let mut buf = [0; 16]; LittleEndian::$write(&mut buf, n.clone(), $bytes); - n == LittleEndian::$read(&mut buf[..$bytes], $bytes) + n == LittleEndian::$read(&buf[..$bytes], $bytes) } qc_sized(prop as fn($ty_int) -> bool, $max); } @@ -2481,7 +2518,7 @@ fn prop(n: $ty_int) -> bool { let mut buf = [0; 16]; NativeEndian::$write(&mut buf, n.clone(), $bytes); - n == NativeEndian::$read(&mut buf[..$bytes], $bytes) + n == NativeEndian::$read(&buf[..$bytes], $bytes) } qc_sized(prop as fn($ty_int) -> bool, $max); } @@ -2500,7 +2537,7 @@ let bytes = size_of::<$ty_int>(); let mut buf = [0; 16]; BigEndian::$write(&mut buf[16 - bytes..], n.clone()); - n == BigEndian::$read(&mut buf[16 - bytes..]) + n == BigEndian::$read(&buf[16 - bytes..]) } qc_sized(prop as fn($ty_int) -> bool, $max - 1); } @@ -2511,7 +2548,7 @@ let bytes = size_of::<$ty_int>(); let mut buf = [0; 16]; LittleEndian::$write(&mut buf[..bytes], n.clone()); - n == LittleEndian::$read(&mut buf[..bytes]) + n == LittleEndian::$read(&buf[..bytes]) } qc_sized(prop as fn($ty_int) -> bool, $max - 1); } @@ -2522,7 +2559,7 @@ let bytes = size_of::<$ty_int>(); let mut buf = [0; 16]; NativeEndian::$write(&mut buf[..bytes], n.clone()); - n == NativeEndian::$read(&mut buf[..bytes]) + n == NativeEndian::$read(&buf[..bytes]) } qc_sized(prop as fn($ty_int) -> bool, $max - 1); } @@ -2956,7 +2993,7 @@ fn uint_bigger_buffer() { use {ByteOrder, LittleEndian}; let n = LittleEndian::read_uint(&[1, 2, 3, 4, 5, 6, 7, 8], 5); - assert_eq!(n, 0x0504030201); + assert_eq!(n, 0x05_0403_0201); } }