From add371d263e1d8d9205d80889ba6565af01b16b4 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 6 Nov 2023 19:22:43 +0000 Subject: [PATCH] Remove `core2` dependency entirely --- Cargo-minimal.lock | 21 --------------------- Cargo-recent.lock | 21 --------------------- bitcoin/Cargo.toml | 2 +- bitcoin/src/crypto/key.rs | 2 +- contrib/test.sh | 2 -- hashes/Cargo.toml | 4 ++-- hashes/contrib/test.sh | 2 +- hashes/embedded/Cargo.toml | 2 +- hashes/src/impls.rs | 4 ++-- io/Cargo.toml | 5 +---- 10 files changed, 9 insertions(+), 56 deletions(-) diff --git a/Cargo-minimal.lock b/Cargo-minimal.lock index 9f7011eb..52268334 100644 --- a/Cargo-minimal.lock +++ b/Cargo-minimal.lock @@ -72,9 +72,6 @@ dependencies = [ [[package]] name = "bitcoin-io" version = "0.1.0" -dependencies = [ - "core2", -] [[package]] name = "bitcoin_hashes" @@ -116,15 +113,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de" -[[package]] -name = "core2" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cf12d2dad3ed124aa116f59561428478993d69ab81ae4d30e5349c9c5b5a5f6" -dependencies = [ - "memchr", -] - [[package]] name = "dyn-clone" version = "1.0.0" @@ -153,9 +141,6 @@ name = "hex-conservative" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30ed443af458ccb6d81c1e7e661545f94d3176752fb1df2f543b902a1e0f51e2" -dependencies = [ - "core2", -] [[package]] name = "hex_lit" @@ -198,12 +183,6 @@ version = "0.2.64" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74dfca3d9957906e8d1e6a0b641dc9a59848e793f1da2165889fd4f62d10d79c" -[[package]] -name = "memchr" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e01e64d9017d18e7fc09d8e4fe0e28ff6931019e979fb8019319db7ca827f8a6" - [[package]] name = "memmap2" version = "0.5.10" diff --git a/Cargo-recent.lock b/Cargo-recent.lock index 932cd2b5..27677e11 100644 --- a/Cargo-recent.lock +++ b/Cargo-recent.lock @@ -71,9 +71,6 @@ dependencies = [ [[package]] name = "bitcoin-io" version = "0.1.0" -dependencies = [ - "core2", -] [[package]] name = "bitcoin_hashes" @@ -115,15 +112,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core2" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239fa3ae9b63c2dc74bd3fa852d4792b8b305ae64eeede946265b6af62f1fff3" -dependencies = [ - "memchr", -] - [[package]] name = "dyn-clone" version = "1.0.11" @@ -152,9 +140,6 @@ name = "hex-conservative" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30ed443af458ccb6d81c1e7e661545f94d3176752fb1df2f543b902a1e0f51e2" -dependencies = [ - "core2", -] [[package]] name = "hex_lit" @@ -197,12 +182,6 @@ version = "0.2.142" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a987beff54b60ffa6d51982e1aa1146bc42f19bd26be28b0586f252fccf5317" -[[package]] -name = "memchr" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - [[package]] name = "memmap2" version = "0.5.10" diff --git a/bitcoin/Cargo.toml b/bitcoin/Cargo.toml index 5556e3e4..0b9933cc 100644 --- a/bitcoin/Cargo.toml +++ b/bitcoin/Cargo.toml @@ -27,7 +27,7 @@ bitcoinconsensus-std = ["bitcoinconsensus/std", "std"] # Instead no-std enables additional features required for this crate to be usable without std. # As a result, both can be enabled without conflict. std = ["secp256k1/std", "bitcoin-io/std", "hashes/std", "bech32/std", "internals/std", "hex/std"] -no-std = ["hashes/alloc", "hashes/core2", "bitcoin-io/core2", "bitcoin-io/alloc", "bech32/alloc", "secp256k1/alloc", "hex/alloc", "hex/core2"] +no-std = ["hashes/alloc", "hashes/io", "bitcoin-io/alloc", "bech32/alloc", "secp256k1/alloc", "hex/alloc"] [package.metadata.docs.rs] all-features = true diff --git a/bitcoin/src/crypto/key.rs b/bitcoin/src/crypto/key.rs index 5352a505..5fc95e6c 100644 --- a/bitcoin/src/crypto/key.rs +++ b/bitcoin/src/crypto/key.rs @@ -84,7 +84,7 @@ impl PublicKey { reader.read_exact(&mut bytes[1..])?; Self::from_slice(bytes).map_err(|e| { - // Need a static string for core2 + // Need a static string for no-std io #[cfg(feature = "std")] let reason = e; #[cfg(not(feature = "std"))] diff --git a/contrib/test.sh b/contrib/test.sh index 986f48f4..96ea2d70 100755 --- a/contrib/test.sh +++ b/contrib/test.sh @@ -17,8 +17,6 @@ if cargo --version | grep ${MSRV}; then cargo update -p schemars --precise 0.8.12 # schemars_derive 0.8.13 uses edition 2021 cargo update -p schemars_derive --precise 0.8.12 - # memchr 2.6.0 uses edition 2021 - cargo update -p memchr --precise 2.5.0 # byteorder 1.5.0 uses edition 2021 cargo update -p byteorder --precise 1.4.3 diff --git a/hashes/Cargo.toml b/hashes/Cargo.toml index 276fb3de..7c298aa3 100644 --- a/hashes/Cargo.toml +++ b/hashes/Cargo.toml @@ -17,8 +17,8 @@ default = ["std"] std = ["alloc", "hex/std", "bitcoin-io/std"] alloc = ["hex/alloc"] serde-std = ["serde/std"] -# If you want I/O you must enable either "std" or "core2". -core2 = ["bitcoin-io/core2", "hex/core2"] +# If you want I/O you must enable either "std" or "io". +io = ["bitcoin-io"] # Smaller (but slower) implementation of sha256, sha512 and ripemd160 small-hash = [] diff --git a/hashes/contrib/test.sh b/hashes/contrib/test.sh index 37160d0e..a0dc5e34 100755 --- a/hashes/contrib/test.sh +++ b/hashes/contrib/test.sh @@ -2,7 +2,7 @@ set -ex -FEATURES="serde serde-std std core2 alloc" +FEATURES="serde serde-std std io alloc" cargo --version rustc --version diff --git a/hashes/embedded/Cargo.toml b/hashes/embedded/Cargo.toml index 5bb9af26..5d9644c4 100644 --- a/hashes/embedded/Cargo.toml +++ b/hashes/embedded/Cargo.toml @@ -18,7 +18,7 @@ cortex-m-rt = "0.6.10" cortex-m-semihosting = "0.3.3" panic-halt = "0.2.0" alloc-cortex-m = { version = "0.4.1", optional = true } -bitcoin_hashes = { path="../", default-features = false, features = ["core2"] } +bitcoin_hashes = { path="../", default-features = false, features = ["io"] } bitcoin-io = { path = "../../io", default_features = false } [[bin]] diff --git a/hashes/src/impls.rs b/hashes/src/impls.rs index 57c9a723..0f7cc5a0 100644 --- a/hashes/src/impls.rs +++ b/hashes/src/impls.rs @@ -1,8 +1,8 @@ // SPDX-License-Identifier: CC0-1.0 -//! `std` / `core2` Impls. +//! `std` / `io` Impls. //! -//! Implementations of traits defined in `std` / `core2` and not in `core`. +//! Implementations of traits defined in `std` / `io` and not in `core`. //! use bitcoin_io::impl_write; diff --git a/io/Cargo.toml b/io/Cargo.toml index ea5bc43a..87101120 100644 --- a/io/Cargo.toml +++ b/io/Cargo.toml @@ -15,11 +15,8 @@ exclude = ["tests", "contrib"] [features] default = ["std"] std = [] -alloc = ["core2/alloc"] +alloc = [] [package.metadata.docs.rs] all-features = true rustdoc-args = ["--cfg", "docsrs"] - -[dependencies] -core2 = { version = "0.3", default-features = false, optional = true }