diff -Nru rust-byte-tools-0.2.0/Cargo.toml rust-byte-tools-0.3.0/Cargo.toml --- rust-byte-tools-0.2.0/Cargo.toml 1970-01-01 00:00:00.000000000 +0000 +++ rust-byte-tools-0.3.0/Cargo.toml 1970-01-01 00:00:00.000000000 +0000 @@ -12,9 +12,9 @@ [package] name = "byte-tools" -version = "0.2.0" -authors = ["The Rust-Crypto Project Developers"] -description = "Utility functions for working with bytes" +version = "0.3.0" +authors = ["RustCrypto Developers"] +description = "Bytes related utility functions" documentation = "https://docs.rs/byte-tools" keywords = ["bytes"] license = "MIT/Apache-2.0" diff -Nru rust-byte-tools-0.2.0/Cargo.toml.orig rust-byte-tools-0.3.0/Cargo.toml.orig --- rust-byte-tools-0.2.0/Cargo.toml.orig 2017-06-06 11:22:47.000000000 +0000 +++ rust-byte-tools-0.3.0/Cargo.toml.orig 2018-08-22 02:19:18.000000000 +0000 @@ -1,9 +1,9 @@ [package] name = "byte-tools" -version = "0.2.0" -authors = ["The Rust-Crypto Project Developers"] +version = "0.3.0" +authors = ["RustCrypto Developers"] license = "MIT/Apache-2.0" -description = "Utility functions for working with bytes" +description = "Bytes related utility functions" documentation = "https://docs.rs/byte-tools" repository = "https://github.com/RustCrypto/utils" keywords = ["bytes"] diff -Nru rust-byte-tools-0.2.0/debian/cargo-checksum.json rust-byte-tools-0.3.0/debian/cargo-checksum.json --- rust-byte-tools-0.2.0/debian/cargo-checksum.json 2018-07-16 06:02:58.000000000 +0000 +++ rust-byte-tools-0.3.0/debian/cargo-checksum.json 2018-10-09 07:33:32.000000000 +0000 @@ -1 +1 @@ -{"package":"560c32574a12a89ecd91f5e742165893f86e3ab98d21f8ea548658eb9eef5f40","files":{}} +{"package":"980479e6fde23246dfb54d47580d66b4e99202e7579c5eaa9fe10ecb5ebd2182","files":{}} diff -Nru rust-byte-tools-0.2.0/debian/changelog rust-byte-tools-0.3.0/debian/changelog --- rust-byte-tools-0.2.0/debian/changelog 2018-07-16 06:02:58.000000000 +0000 +++ rust-byte-tools-0.3.0/debian/changelog 2018-10-09 07:33:32.000000000 +0000 @@ -1,3 +1,9 @@ +rust-byte-tools (0.3.0-1) unstable; urgency=medium + + * Package byte-tools 0.3.0 from crates.io using debcargo 2.2.7 + + -- kpcyrd Tue, 09 Oct 2018 09:33:32 +0200 + rust-byte-tools (0.2.0-1) unstable; urgency=medium * Package byte-tools 0.2.0 from crates.io using debcargo 2.2.3 diff -Nru rust-byte-tools-0.2.0/debian/control rust-byte-tools-0.3.0/debian/control --- rust-byte-tools-0.2.0/debian/control 2018-07-16 06:02:58.000000000 +0000 +++ rust-byte-tools-0.3.0/debian/control 2018-10-09 07:33:32.000000000 +0000 @@ -2,13 +2,14 @@ Section: rust Priority: optional Build-Depends: debhelper (>= 11), - dh-cargo (>= 6), + dh-cargo (>= 10), cargo:native , rustc:native , libstd-rust-dev Maintainer: Debian Rust Maintainers -Uploaders: kpcyrd -Standards-Version: 4.1.5 +Uploaders: + kpcyrd +Standards-Version: 4.2.0 Vcs-Git: https://salsa.debian.org/rust-team/debcargo-conf.git [src/byte-tools] Vcs-Browser: https://salsa.debian.org/rust-team/debcargo-conf/tree/master/src/byte-tools @@ -21,10 +22,10 @@ librust-byte-tools+default-dev (= ${binary:Version}), librust-byte-tools-0-dev (= ${binary:Version}), librust-byte-tools-0+default-dev (= ${binary:Version}), - librust-byte-tools-0.2-dev (= ${binary:Version}), - librust-byte-tools-0.2+default-dev (= ${binary:Version}), - librust-byte-tools-0.2.0-dev (= ${binary:Version}), - librust-byte-tools-0.2.0+default-dev (= ${binary:Version}) -Description: Utility functions for working with bytes - Rust source code + librust-byte-tools-0.3-dev (= ${binary:Version}), + librust-byte-tools-0.3+default-dev (= ${binary:Version}), + librust-byte-tools-0.3.0-dev (= ${binary:Version}), + librust-byte-tools-0.3.0+default-dev (= ${binary:Version}) +Description: Bytes related utility functions - Rust source code This package contains the source for the Rust byte-tools crate, packaged by debcargo for use with cargo and dh-cargo. diff -Nru rust-byte-tools-0.2.0/debian/copyright rust-byte-tools-0.3.0/debian/copyright --- rust-byte-tools-0.2.0/debian/copyright 2018-07-16 06:02:58.000000000 +0000 +++ rust-byte-tools-0.3.0/debian/copyright 2018-10-09 07:33:32.000000000 +0000 @@ -1,11 +1,11 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: byte-tools -Upstream-Contact: The Rust-Crypto Project Developers +Upstream-Contact: RustCrypto Developers Source: https://github.com/RustCrypto/utils Files: * Copyright: - 2016-2017 The Rust-Crypto Project Developers + 2016-2018 RustCrypto Developers 2006-2009 Graydon Hoare 2009-2013 Mozilla Foundation License: MIT or Apache-2.0 diff -Nru rust-byte-tools-0.2.0/debian/copyright.debcargo.hint rust-byte-tools-0.3.0/debian/copyright.debcargo.hint --- rust-byte-tools-0.2.0/debian/copyright.debcargo.hint 2018-07-16 06:02:58.000000000 +0000 +++ rust-byte-tools-0.3.0/debian/copyright.debcargo.hint 2018-10-09 07:33:32.000000000 +0000 @@ -1,10 +1,10 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: byte-tools -Upstream-Contact: The Rust-Crypto Project Developers +Upstream-Contact: RustCrypto Developers Source: https://github.com/RustCrypto/utils Files: * -Copyright: FIXME (overlay) UNKNOWN-YEARS The Rust-Crypto Project Developers +Copyright: FIXME (overlay) UNKNOWN-YEARS RustCrypto Developers License: MIT or Apache-2.0 Comment: FIXME (overlay): Since upstream copyright years are not available in @@ -24,7 +24,7 @@ Files: debian/* Copyright: 2018 Debian Rust Maintainers - 2018 FIXME (overlay) Your Name + 2018 kpcyrd License: MIT or Apache-2.0 License: Apache-2.0 diff -Nru rust-byte-tools-0.2.0/debian/debcargo.toml rust-byte-tools-0.3.0/debian/debcargo.toml --- rust-byte-tools-0.2.0/debian/debcargo.toml 2018-07-16 06:02:58.000000000 +0000 +++ rust-byte-tools-0.3.0/debian/debcargo.toml 2018-10-09 07:33:32.000000000 +0000 @@ -1 +1,2 @@ overlay = "." +uploaders = ["kpcyrd "] diff -Nru rust-byte-tools-0.2.0/debian/watch rust-byte-tools-0.3.0/debian/watch --- rust-byte-tools-0.2.0/debian/watch 2018-07-16 06:02:58.000000000 +0000 +++ rust-byte-tools-0.3.0/debian/watch 2018-10-09 07:33:32.000000000 +0000 @@ -1,4 +1,5 @@ version=4 -opts=filenamemangle=s/.*\/(.*)\/download/byte-tools-$1\.tar\.gz/g\ - https://qa.debian.org/cgi-bin/fakeupstream.cgi?upstream=crates.io/byte-tools .*/crates/byte-tools/@ANY_VERSION@/download +opts=filenamemangle=s/.*\/(.*)\/download/byte-tools-$1\.tar\.gz/g,\ +uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha)\d*)$/$1~$2/ \ +https://qa.debian.org/cgi-bin/fakeupstream.cgi?upstream=crates.io/byte-tools .*/crates/byte-tools/@ANY_VERSION@/download diff -Nru rust-byte-tools-0.2.0/src/lib.rs rust-byte-tools-0.3.0/src/lib.rs --- rust-byte-tools-0.2.0/src/lib.rs 2017-06-08 16:59:00.000000000 +0000 +++ rust-byte-tools-0.3.0/src/lib.rs 2018-08-22 02:23:26.000000000 +0000 @@ -1,37 +1,29 @@ #![no_std] use core::ptr; -mod read_single; -mod write_single; -mod read_slice; -mod write_slice; - -pub use read_single::*; -pub use write_single::*; -pub use read_slice::*; -pub use write_slice::*; - -/// Copy bytes from src to dest -#[inline] -pub fn copy_memory(src: &[u8], dst: &mut [u8]) { +/// Copy bytes from `src` to `dst` +/// +/// Panics if `src.len() < dst.len()` +#[inline(always)] +pub fn copy(src: &[u8], dst: &mut [u8]) { assert!(dst.len() >= src.len()); unsafe { - let srcp = src.as_ptr(); - let dstp = dst.as_mut_ptr(); - ptr::copy_nonoverlapping(srcp, dstp, src.len()); + ptr::copy_nonoverlapping(src.as_ptr(), dst.as_mut_ptr(), src.len()); } } -/// Zero all bytes in dst -#[inline] +/// Zero all bytes in `dst` +#[inline(always)] pub fn zero(dst: &mut [u8]) { - set(dst, 0); + unsafe { + ptr::write_bytes(dst.as_mut_ptr(), 0, dst.len()); + } } /// Sets all bytes in `dst` equal to `value` -#[inline] +#[inline(always)] pub fn set(dst: &mut [u8], value: u8) { unsafe { ptr::write_bytes(dst.as_mut_ptr(), value, dst.len()); } -} \ No newline at end of file +} diff -Nru rust-byte-tools-0.2.0/src/read_single.rs rust-byte-tools-0.3.0/src/read_single.rs --- rust-byte-tools-0.2.0/src/read_single.rs 2017-06-06 11:13:01.000000000 +0000 +++ rust-byte-tools-0.3.0/src/read_single.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -use core::{mem, ptr}; - -macro_rules! read_single { - ($src:expr, $size:expr, $ty:ty, $which:ident) => ({ - assert!($size == mem::size_of::<$ty>()); - assert!($size == $src.len()); - unsafe { - let mut tmp: $ty = mem::uninitialized(); - let p = &mut tmp as *mut _ as *mut u8; - ptr::copy_nonoverlapping($src.as_ptr(), p, $size); - tmp.$which() - } - }); -} - -/// Read the value of a vector of bytes as a u32 value in little-endian format. -#[inline] -pub fn read_u32_le(src: &[u8]) -> u32 { - read_single!(src, 4, u32, to_le) -} - -/// Read the value of a vector of bytes as a u32 value in big-endian format. -#[inline] -pub fn read_u32_be(src: &[u8]) -> u32 { - read_single!(src, 4, u32, to_be) -} - -/// Read the value of a vector of bytes as a u64 value in little-endian format. -#[inline] -pub fn read_u64_le(src: &[u8]) -> u64 { - read_single!(src, 8, u64, to_le) -} - -/// Read the value of a vector of bytes as a u64 value in big-endian format. -#[inline] -pub fn read_u64_be(src: &[u8]) -> u64 { - read_single!(src, 8, u64, to_be) -} diff -Nru rust-byte-tools-0.2.0/src/read_slice.rs rust-byte-tools-0.3.0/src/read_slice.rs --- rust-byte-tools-0.2.0/src/read_slice.rs 2017-06-06 09:30:10.000000000 +0000 +++ rust-byte-tools-0.3.0/src/read_slice.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -use core::ptr; - -macro_rules! read_slice { - ($src:expr, $dst:expr, $size:expr, $which:ident) => ({ - assert_eq!($size*$dst.len(), $src.len()); - unsafe { - ptr::copy_nonoverlapping( - $src.as_ptr(), - $dst.as_mut_ptr() as *mut u8, - $src.len()); - } - for v in $dst.iter_mut() { - *v = v.$which(); - } - }); -} - -/// Read a vector of bytes into a vector of u32s. The values are read in -/// little-endian format. -#[inline] -pub fn read_u32v_le(dst: &mut [u32], src: &[u8]) { - read_slice!(src, dst, 4, to_le); -} - -/// Read a vector of bytes into a vector of u32s. The values are read in -/// big-endian format. -#[inline] -pub fn read_u32v_be(dst: &mut [u32], src: &[u8]) { - read_slice!(src, dst, 4, to_be); -} - -/// Read a vector of bytes into a vector of u64s. The values are read in -/// little-endian format. -#[inline] -pub fn read_u64v_le(dst: &mut [u64], src: &[u8]) { - read_slice!(src, dst, 8, to_le); -} - -/// Read a vector of bytes into a vector of u64s. The values are read in -/// big-endian format. -#[inline] -pub fn read_u64v_be(dst: &mut [u64], src: &[u8]) { - read_slice!(src, dst, 8, to_be); -} diff -Nru rust-byte-tools-0.2.0/src/write_single.rs rust-byte-tools-0.3.0/src/write_single.rs --- rust-byte-tools-0.2.0/src/write_single.rs 2017-06-06 11:12:57.000000000 +0000 +++ rust-byte-tools-0.3.0/src/write_single.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -use core::{mem, ptr}; - -macro_rules! write_single { - ($dst:expr, $n:expr, $size:expr, $which:ident) => ({ - assert!($size == $dst.len()); - unsafe { - let bytes = mem::transmute::<_, [u8; $size]>($n.$which()); - ptr::copy_nonoverlapping((&bytes).as_ptr(), $dst.as_mut_ptr(), $size); - } - }); -} - -/// Write a u32 into a vector, which must be 4 bytes long. The value is written -/// in little-endian format. -#[inline] -pub fn write_u32_le(dst: &mut [u8], n: u32) { - write_single!(dst, n, 4, to_le); -} - -/// Write a u32 into a vector, which must be 4 bytes long. The value is written -/// in big-endian format. -#[inline] -pub fn write_u32_be(dst: &mut [u8], n: u32) { - write_single!(dst, n, 4, to_be); -} - -/// Write a u64 into a vector, which must be 8 bytes long. The value is written -/// in little-endian format. -#[inline] -pub fn write_u64_le(dst: &mut [u8], n: u64) { - write_single!(dst, n, 8, to_le); -} - -/// Write a u64 into a vector, which must be 8 bytes long. The value is written -/// in big-endian format. -#[inline] -pub fn write_u64_be(dst: &mut [u8], n: u64) { - write_single!(dst, n, 8, to_be); -} diff -Nru rust-byte-tools-0.2.0/src/write_slice.rs rust-byte-tools-0.3.0/src/write_slice.rs --- rust-byte-tools-0.2.0/src/write_slice.rs 2017-06-06 15:08:39.000000000 +0000 +++ rust-byte-tools-0.3.0/src/write_slice.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -use core::{ptr, mem}; - -macro_rules! write_slice { - ($src:expr, $dst:expr, $ty:ty, $size:expr, $which:ident) => ({ - assert!($size == mem::size_of::<$ty>()); - assert_eq!($dst.len(), $size*$src.len()); - unsafe { - ptr::copy_nonoverlapping( - $src.as_ptr() as *const u8, - $dst.as_mut_ptr(), - $dst.len()); - let tmp: &mut [$ty] = mem::transmute($dst); - for v in tmp[..$src.len()].iter_mut() { - *v = v.$which(); - } - } - }); -} - -/// Write a vector of u32s into a vector of bytes. The values are written in -/// little-endian format. -#[inline] -pub fn write_u32v_le(dst: &mut [u8], src: &[u32]) { - write_slice!(src, dst, u32, 4, to_le); -} - -/// Write a vector of u32s into a vector of bytes. The values are written in -/// big-endian format. -#[inline] -pub fn write_u32v_be(dst: &mut [u8], src: &[u32]) { - write_slice!(src, dst, u32, 4, to_be); -} - -/// Write a vector of u64s into a vector of bytes. The values are written in -/// little-endian format. -#[inline] -pub fn write_u64v_le(dst: &mut [u8], src: &[u64]) { - write_slice!(src, dst, u64, 8, to_le); -} - -/// Write a vector of u64s into a vector of bytes. The values are written in -/// little-endian format. -#[inline] -pub fn write_u64v_be(dst: &mut [u8], src: &[u64]) { - write_slice!(src, dst, u64, 8, to_be); -}