Update to edition 2021
We just bumped the MSRV to Rust 1.56.1 which includes edition 2021. Update all crates in this repo to use edition 2021 and build/lint warnings.
This commit is contained in:
parent
d9cc724187
commit
a41e978855
|
@ -1,5 +1,6 @@
|
||||||
[workspace]
|
[workspace]
|
||||||
members = ["bitcoin", "hashes", "internals", "fuzz", "io"]
|
members = ["bitcoin", "hashes", "internals", "fuzz", "io"]
|
||||||
|
resolver = "2"
|
||||||
|
|
||||||
[patch.crates-io.bitcoin]
|
[patch.crates-io.bitcoin]
|
||||||
path = "bitcoin"
|
path = "bitcoin"
|
||||||
|
|
|
@ -9,7 +9,7 @@ description = "General purpose library for using and interoperating with Bitcoin
|
||||||
categories = ["cryptography::cryptocurrencies"]
|
categories = ["cryptography::cryptocurrencies"]
|
||||||
keywords = [ "crypto", "bitcoin" ]
|
keywords = [ "crypto", "bitcoin" ]
|
||||||
readme = "../README.md"
|
readme = "../README.md"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
exclude = ["tests", "contrib"]
|
exclude = ["tests", "contrib"]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
authors = ["Riccardo Casatta <riccardo@casatta.it>", "Dev Random <c1.devrandom@niftybox.net>"]
|
authors = ["Riccardo Casatta <riccardo@casatta.it>", "Dev Random <c1.devrandom@niftybox.net>"]
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
name = "embedded"
|
name = "embedded"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
|
|
@ -374,14 +374,12 @@ impl<'de> serde::Deserialize<'de> for LockTime {
|
||||||
// calls visit_u64, even when called from Deserializer::deserialize_u32. The
|
// calls visit_u64, even when called from Deserializer::deserialize_u32. The
|
||||||
// other visit_u*s have default implementations that forward to visit_u64.
|
// other visit_u*s have default implementations that forward to visit_u64.
|
||||||
fn visit_u64<E: serde::de::Error>(self, v: u64) -> Result<u32, E> {
|
fn visit_u64<E: serde::de::Error>(self, v: u64) -> Result<u32, E> {
|
||||||
use core::convert::TryInto;
|
|
||||||
v.try_into().map_err(|_| {
|
v.try_into().map_err(|_| {
|
||||||
E::invalid_value(serde::de::Unexpected::Unsigned(v), &"a 32-bit number")
|
E::invalid_value(serde::de::Unexpected::Unsigned(v), &"a 32-bit number")
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// Also do the signed version, just for good measure.
|
// Also do the signed version, just for good measure.
|
||||||
fn visit_i64<E: serde::de::Error>(self, v: i64) -> Result<u32, E> {
|
fn visit_i64<E: serde::de::Error>(self, v: i64) -> Result<u32, E> {
|
||||||
use core::convert::TryInto;
|
|
||||||
v.try_into().map_err(|_| {
|
v.try_into().map_err(|_| {
|
||||||
E::invalid_value(serde::de::Unexpected::Signed(v), &"a 32-bit number")
|
E::invalid_value(serde::de::Unexpected::Signed(v), &"a 32-bit number")
|
||||||
})
|
})
|
||||||
|
|
|
@ -834,8 +834,6 @@ impl crate::serde::Serialize for U256 {
|
||||||
#[cfg(feature = "serde")]
|
#[cfg(feature = "serde")]
|
||||||
impl<'de> crate::serde::Deserialize<'de> for U256 {
|
impl<'de> crate::serde::Deserialize<'de> for U256 {
|
||||||
fn deserialize<D: crate::serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
|
fn deserialize<D: crate::serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
|
||||||
use core::convert::TryInto;
|
|
||||||
|
|
||||||
use hex::FromHex;
|
use hex::FromHex;
|
||||||
|
|
||||||
use crate::serde::de;
|
use crate::serde::de;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "bitcoin-fuzz"
|
name = "bitcoin-fuzz"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
authors = ["Generated by fuzz/generate-files.sh"]
|
authors = ["Generated by fuzz/generate-files.sh"]
|
||||||
publish = false
|
publish = false
|
||||||
|
|
|
@ -11,7 +11,7 @@ source "$REPO_DIR/fuzz/fuzz-util.sh"
|
||||||
cat > "$REPO_DIR/fuzz/Cargo.toml" <<EOF
|
cat > "$REPO_DIR/fuzz/Cargo.toml" <<EOF
|
||||||
[package]
|
[package]
|
||||||
name = "bitcoin-fuzz"
|
name = "bitcoin-fuzz"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
authors = ["Generated by fuzz/generate-files.sh"]
|
authors = ["Generated by fuzz/generate-files.sh"]
|
||||||
publish = false
|
publish = false
|
||||||
|
|
|
@ -9,7 +9,7 @@ description = "Hash functions used by the rust-bitcoin eccosystem"
|
||||||
categories = ["algorithms"]
|
categories = ["algorithms"]
|
||||||
keywords = [ "crypto", "bitcoin", "hash", "digest" ]
|
keywords = [ "crypto", "bitcoin", "hash", "digest" ]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
exclude = ["tests", "contrib"]
|
exclude = ["tests", "contrib"]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
authors = ["Riccardo Casatta <riccardo@casatta.it>"]
|
authors = ["Riccardo Casatta <riccardo@casatta.it>"]
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
name = "embedded"
|
name = "embedded"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
name = "schemars"
|
name = "schemars"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
authors = ["Jeremy Rubin <j@rubin.io>"]
|
authors = ["Jeremy Rubin <j@rubin.io>"]
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
|
|
||||||
# Prevent this from interfering with workspaces
|
# Prevent this from interfering with workspaces
|
||||||
[workspace]
|
[workspace]
|
||||||
|
|
|
@ -102,10 +102,10 @@ impl HashEngine {
|
||||||
|
|
||||||
for (i, &wi) in w.iter().enumerate() {
|
for (i, &wi) in w.iter().enumerate() {
|
||||||
let (f, k) = match i {
|
let (f, k) = match i {
|
||||||
0...19 => ((b & c) | (!b & d), 0x5a827999),
|
0..=19 => ((b & c) | (!b & d), 0x5a827999),
|
||||||
20...39 => (b ^ c ^ d, 0x6ed9eba1),
|
20..=39 => (b ^ c ^ d, 0x6ed9eba1),
|
||||||
40...59 => ((b & c) | (b & d) | (c & d), 0x8f1bbcdc),
|
40..=59 => ((b & c) | (b & d) | (c & d), 0x8f1bbcdc),
|
||||||
60...79 => (b ^ c ^ d, 0xca62c1d6),
|
60..=79 => (b ^ c ^ d, 0xca62c1d6),
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ description = "Internal types and macros used by rust-bitcoin ecosystem"
|
||||||
categories = ["cryptography::cryptocurrencies"]
|
categories = ["cryptography::cryptocurrencies"]
|
||||||
keywords = ["internal"]
|
keywords = ["internal"]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
exclude = ["tests", "contrib"]
|
exclude = ["tests", "contrib"]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
|
|
@ -57,7 +57,7 @@ trailing_comma = "Vertical"
|
||||||
match_block_trailing_comma = false
|
match_block_trailing_comma = false
|
||||||
blank_lines_upper_bound = 1
|
blank_lines_upper_bound = 1
|
||||||
blank_lines_lower_bound = 0
|
blank_lines_lower_bound = 0
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
version = "One"
|
version = "One"
|
||||||
inline_attribute_width = 0
|
inline_attribute_width = 0
|
||||||
format_generated_files = true
|
format_generated_files = true
|
||||||
|
|
Loading…
Reference in New Issue