Merge pull request #627 from nuttycom/edition_2021

Update to Rust 2021
This commit is contained in:
str4d 2022-09-07 11:41:44 +01:00 committed by GitHub
commit 980f6b4e6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
35 changed files with 30 additions and 42 deletions

View File

@ -6,7 +6,8 @@ authors = ["Jack Grigg <jack@z.cash>"]
homepage = "https://github.com/zcash/librustzcash" homepage = "https://github.com/zcash/librustzcash"
repository = "https://github.com/zcash/librustzcash" repository = "https://github.com/zcash/librustzcash"
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2018" edition = "2021"
rust-version = "1.56.1"
[dependencies] [dependencies]
blake2b_simd = "1" blake2b_simd = "1"

View File

@ -9,3 +9,4 @@ and this library adheres to Rust's notion of
## [0.1.0] - 2022-05-11 ## [0.1.0] - 2022-05-11
Initial release. Initial release.
MSRV is 1.51

View File

@ -12,6 +12,7 @@ repository = "https://github.com/zcash/librustzcash"
readme = "README.md" readme = "README.md"
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2018" edition = "2018"
rust-version = "1.51"
categories = ["encoding"] categories = ["encoding"]
keywords = ["feistel"] keywords = ["feistel"]

View File

@ -12,6 +12,9 @@ and this library adheres to Rust's notion of
- `zcash_address::TryFromRawAddress` - `zcash_address::TryFromRawAddress`
- `zcash_address::ZcashAddress::convert_if_network` - `zcash_address::ZcashAddress::convert_if_network`
### Changed
- MSRV is now 1.52
### Removed ### Removed
- `zcash_address::FromAddress` (use `TryFromAddress` instead). - `zcash_address::FromAddress` (use `TryFromAddress` instead).

View File

@ -10,6 +10,7 @@ repository = "https://github.com/zcash/librustzcash"
readme = "README.md" readme = "README.md"
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2018" edition = "2018"
rust-version = "1.52"
categories = ["cryptography::cryptocurrencies", "encoding"] categories = ["cryptography::cryptocurrencies", "encoding"]
keywords = ["zcash", "address", "sapling", "unified"] keywords = ["zcash", "address", "sapling", "unified"]

View File

@ -7,5 +7,8 @@ and this library adheres to Rust's notion of
## [Unreleased] ## [Unreleased]
### Changed
- MSRV is now 1.52
## [0.1.0] - 2022-05-11 ## [0.1.0] - 2022-05-11
Initial release. Initial release.

View File

@ -10,7 +10,8 @@ homepage = "https://github.com/zcash/librustzcash"
repository = "https://github.com/zcash/librustzcash" repository = "https://github.com/zcash/librustzcash"
readme = "README.md" readme = "README.md"
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2018" edition = "2021"
rust-version = "1.56.1"
categories = ["cryptography::cryptocurrencies", "encoding"] categories = ["cryptography::cryptocurrencies", "encoding"]
keywords = ["zcash"] keywords = ["zcash"]

View File

@ -10,7 +10,6 @@
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt}; use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
use nonempty::NonEmpty; use nonempty::NonEmpty;
use std::convert::TryFrom;
use std::io::{self, Read, Write}; use std::io::{self, Read, Write};
use std::iter::FromIterator; use std::iter::FromIterator;
@ -271,7 +270,6 @@ impl Optional {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
use std::convert::{TryFrom, TryInto};
use std::fmt::Debug; use std::fmt::Debug;
#[test] #[test]

View File

@ -10,7 +10,8 @@ homepage = "https://github.com/zcash/librustzcash"
repository = "https://github.com/zcash/librustzcash" repository = "https://github.com/zcash/librustzcash"
readme = "README.md" readme = "README.md"
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2018" edition = "2021"
rust-version = "1.56.1"
categories = ["cryptography::cryptocurrencies"] categories = ["cryptography::cryptocurrencies"]
[package.metadata.docs.rs] [package.metadata.docs.rs]

View File

@ -24,8 +24,6 @@ extern crate alloc;
#[cfg(feature = "alloc")] #[cfg(feature = "alloc")]
use alloc::vec::Vec; use alloc::vec::Vec;
use core::convert::TryInto;
use chacha20::{ use chacha20::{
cipher::{NewCipher, StreamCipher, StreamCipherSeek}, cipher::{NewCipher, StreamCipher, StreamCipherSeek},
ChaCha20, ChaCha20,

View File

@ -10,7 +10,8 @@ homepage = "https://github.com/zcash/librustzcash"
repository = "https://github.com/zcash/librustzcash" repository = "https://github.com/zcash/librustzcash"
readme = "README.md" readme = "README.md"
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2018" edition = "2021"
rust-version = "1.56.1"
[dependencies] [dependencies]
base64 = "0.13" base64 = "0.13"

View File

@ -1,5 +1,3 @@
use std::convert::TryInto;
use gumdrop::Options; use gumdrop::Options;
use zcash_client_backend::encoding::{decode_extended_full_viewing_key, encode_payment_address}; use zcash_client_backend::encoding::{decode_extended_full_viewing_key, encode_payment_address};
use zcash_primitives::{ use zcash_primitives::{

View File

@ -7,7 +7,6 @@
use bech32::{self, Error, FromBase32, ToBase32, Variant}; use bech32::{self, Error, FromBase32, ToBase32, Variant};
use bs58::{self, decode::Error as Bs58Error}; use bs58::{self, decode::Error as Bs58Error};
use std::convert::TryInto;
use std::fmt; use std::fmt;
use std::io::{self, Write}; use std::io::{self, Write};
use zcash_primitives::{ use zcash_primitives::{

View File

@ -8,9 +8,6 @@ use zcash_primitives::{
use crate::address::UnifiedAddress; use crate::address::UnifiedAddress;
#[cfg(feature = "transparent-inputs")]
use std::convert::TryInto;
#[cfg(feature = "transparent-inputs")] #[cfg(feature = "transparent-inputs")]
use zcash_primitives::legacy::keys::{self as legacy, IncomingViewingKey}; use zcash_primitives::legacy::keys::{self as legacy, IncomingViewingKey};

View File

@ -1,7 +1,6 @@
//! Generated code for handling light client protobuf structs. //! Generated code for handling light client protobuf structs.
use ff::PrimeField; use ff::PrimeField;
use std::convert::{TryFrom, TryInto};
use zcash_primitives::{ use zcash_primitives::{
block::{BlockHash, BlockHeader}, block::{BlockHash, BlockHeader},

View File

@ -10,7 +10,8 @@ homepage = "https://github.com/zcash/librustzcash"
repository = "https://github.com/zcash/librustzcash" repository = "https://github.com/zcash/librustzcash"
readme = "README.md" readme = "README.md"
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2018" edition = "2021"
rust-version = "1.56.1"
[dependencies] [dependencies]
bech32 = "0.8" bech32 = "0.8"

View File

@ -1,7 +1,6 @@
//! Functions for creating transactions. //! Functions for creating transactions.
//! //!
use rusqlite::{named_params, Row}; use rusqlite::{named_params, Row};
use std::convert::TryInto;
use ff::PrimeField; use ff::PrimeField;

View File

@ -7,3 +7,4 @@ and this library adheres to Rust's notion of
## [Unreleased] ## [Unreleased]
Initial release. Initial release.
MSRV is 1.56.1

View File

@ -6,7 +6,8 @@ authors = ["Jack Grigg <jack@z.cash>", "Kris Nuttycombe <kris@z.cash>"]
homepage = "https://github.com/zcash/librustzcash" homepage = "https://github.com/zcash/librustzcash"
repository = "https://github.com/zcash/librustzcash" repository = "https://github.com/zcash/librustzcash"
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2018" edition = "2021"
rust-version = "1.56.1"
[dependencies] [dependencies]
blake2b_simd = "1" blake2b_simd = "1"

View File

@ -18,8 +18,6 @@
//! - `tx_b`: `[ TzeIn(tx_a, preimage_1) -> TzeOut(value, hash_2) ]` //! - `tx_b`: `[ TzeIn(tx_a, preimage_1) -> TzeOut(value, hash_2) ]`
//! - `tx_c`: `[ TzeIn(tx_b, preimage_2) -> [any output types...] ]` //! - `tx_c`: `[ TzeIn(tx_b, preimage_2) -> [any output types...] ]`
use std::convert::TryFrom;
use std::convert::TryInto;
use std::fmt; use std::fmt;
use std::ops::{Deref, DerefMut}; use std::ops::{Deref, DerefMut};

View File

@ -2,7 +2,8 @@
name = "zcash_history" name = "zcash_history"
version = "0.3.0" version = "0.3.0"
authors = ["NikVolf <nikvolf@gmail.com>"] authors = ["NikVolf <nikvolf@gmail.com>"]
edition = "2018" edition = "2021"
rust-version = "1.56.1"
license = "MIT/Apache-2.0" license = "MIT/Apache-2.0"
documentation = "https://docs.rs/zcash_history/" documentation = "https://docs.rs/zcash_history/"
description = "Library for Zcash blockchain history tools" description = "Library for Zcash blockchain history tools"

View File

@ -10,7 +10,8 @@ homepage = "https://github.com/zcash/librustzcash"
repository = "https://github.com/zcash/librustzcash" repository = "https://github.com/zcash/librustzcash"
readme = "README.md" readme = "README.md"
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2018" edition = "2021"
rust-version = "1.56.1"
categories = ["cryptography::cryptocurrencies"] categories = ["cryptography::cryptocurrencies"]
[package.metadata.docs.rs] [package.metadata.docs.rs]

View File

@ -2,7 +2,6 @@ use hdwallet::{ExtendedPrivKey, ExtendedPubKey, KeyIndex};
use ripemd::Digest as RipemdDigest; use ripemd::Digest as RipemdDigest;
use secp256k1::PublicKey; use secp256k1::PublicKey;
use sha2::{Digest as Sha2Digest, Sha256}; use sha2::{Digest as Sha2Digest, Sha256};
use std::convert::TryInto;
use crate::{consensus, keys::prf_expand_vec, zip32::AccountId}; use crate::{consensus, keys::prf_expand_vec, zip32::AccountId};

View File

@ -1,7 +1,6 @@
//! Structs for handling encrypted memos. //! Structs for handling encrypted memos.
use std::cmp::Ordering; use std::cmp::Ordering;
use std::convert::{TryFrom, TryInto};
use std::error; use std::error;
use std::fmt; use std::fmt;
use std::ops::Deref; use std::ops::Deref;
@ -275,7 +274,6 @@ impl str::FromStr for Memo {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use std::convert::TryInto;
use std::str::FromStr; use std::str::FromStr;
use super::{Error, Memo, MemoBytes}; use super::{Error, Memo, MemoBytes};

View File

@ -7,7 +7,6 @@ use incrementalmerkletree::{
Altitude, Altitude,
}; };
use std::collections::VecDeque; use std::collections::VecDeque;
use std::convert::TryFrom;
use std::io::{self, Read, Write}; use std::io::{self, Read, Write};
use std::iter::repeat; use std::iter::repeat;
use zcash_encoding::{Optional, Vector}; use zcash_encoding::{Optional, Vector};
@ -620,7 +619,6 @@ impl<Node: Hashable> MerklePath<Node> {
mod tests { mod tests {
use incrementalmerkletree::bridgetree::Frontier; use incrementalmerkletree::bridgetree::Frontier;
use proptest::prelude::*; use proptest::prelude::*;
use std::convert::TryInto;
use std::io::{self, Read, Write}; use std::io::{self, Read, Write};
use crate::sapling::{testing::arb_node, Node}; use crate::sapling::{testing::arb_node, Node};

View File

@ -1,7 +1,6 @@
//! Implementations of serialization and parsing for Orchard note commitment trees. //! Implementations of serialization and parsing for Orchard note commitment trees.
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt}; use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
use std::convert::{TryFrom, TryInto};
use std::io::{self, Read, Write}; use std::io::{self, Read, Write};
use incrementalmerkletree::{ use incrementalmerkletree::{

View File

@ -17,7 +17,6 @@ use incrementalmerkletree::{self, Altitude};
use lazy_static::lazy_static; use lazy_static::lazy_static;
use rand_core::{CryptoRng, RngCore}; use rand_core::{CryptoRng, RngCore};
use std::array::TryFromSliceError; use std::array::TryFromSliceError;
use std::convert::{TryFrom, TryInto};
use std::io::{self, Read, Write}; use std::io::{self, Read, Write};
use subtle::{Choice, ConstantTimeEq}; use subtle::{Choice, ConstantTimeEq};
@ -526,7 +525,6 @@ impl Note {
pub mod testing { pub mod testing {
use proptest::prelude::*; use proptest::prelude::*;
use std::cmp::min; use std::cmp::min;
use std::convert::TryFrom;
use crate::{ use crate::{
transaction::components::amount::MAX_MONEY, zip32::testing::arb_extended_spending_key, transaction::components::amount::MAX_MONEY, zip32::testing::arb_extended_spending_key,

View File

@ -4,7 +4,6 @@
//! //!
//! [section 4.2.2]: https://zips.z.cash/protocol/protocol.pdf#saplingkeycomponents //! [section 4.2.2]: https://zips.z.cash/protocol/protocol.pdf#saplingkeycomponents
use std::convert::TryInto;
use std::io::{self, Read, Write}; use std::io::{self, Read, Write};
use crate::{ use crate::{

View File

@ -5,7 +5,6 @@ use ff::PrimeField;
use group::{cofactor::CofactorGroup, GroupEncoding}; use group::{cofactor::CofactorGroup, GroupEncoding};
use jubjub::{AffinePoint, ExtendedPoint}; use jubjub::{AffinePoint, ExtendedPoint};
use rand_core::RngCore; use rand_core::RngCore;
use std::convert::TryInto;
use zcash_note_encryption::{ use zcash_note_encryption::{
try_compact_note_decryption, try_note_decryption, try_output_recovery_with_ock, try_compact_note_decryption, try_note_decryption, try_output_recovery_with_ock,
@ -474,7 +473,6 @@ mod tests {
use group::{cofactor::CofactorGroup, GroupEncoding}; use group::{cofactor::CofactorGroup, GroupEncoding};
use rand_core::OsRng; use rand_core::OsRng;
use rand_core::{CryptoRng, RngCore}; use rand_core::{CryptoRng, RngCore};
use std::convert::TryInto;
use zcash_note_encryption::{ use zcash_note_encryption::{
batch, EphemeralKeyBytes, NoteEncryption, OutgoingCipherKey, ENC_CIPHERTEXT_SIZE, batch, EphemeralKeyBytes, NoteEncryption, OutgoingCipherKey, ENC_CIPHERTEXT_SIZE,

View File

@ -266,7 +266,8 @@ impl<'a, P: consensus::Parameters, R: RngCore> Builder<'a, P, R> {
.ok_or(Error::InvalidAmount)?, .ok_or(Error::InvalidAmount)?,
]; ];
IntoIterator::into_iter(&value_balances) value_balances
.into_iter()
.sum::<Option<_>>() .sum::<Option<_>>()
.ok_or(Error::InvalidAmount) .ok_or(Error::InvalidAmount)
} }

View File

@ -1,5 +1,4 @@
use core::fmt::Debug; use core::fmt::Debug;
use std::convert::TryInto;
use ff::PrimeField; use ff::PrimeField;
use group::GroupEncoding; use group::GroupEncoding;
@ -429,7 +428,6 @@ pub mod testing {
use proptest::collection::vec; use proptest::collection::vec;
use proptest::prelude::*; use proptest::prelude::*;
use rand::{rngs::StdRng, SeedableRng}; use rand::{rngs::StdRng, SeedableRng};
use std::convert::TryFrom;
use crate::{ use crate::{
constants::{SPENDING_KEY_GENERATOR, VALUE_COMMITMENT_RANDOMNESS_GENERATOR}, constants::{SPENDING_KEY_GENERATOR, VALUE_COMMITMENT_RANDOMNESS_GENERATOR},

View File

@ -1,6 +1,5 @@
use crate::legacy::Script; use crate::legacy::Script;
use blake2b_simd::Hash as Blake2bHash; use blake2b_simd::Hash as Blake2bHash;
use std::convert::TryInto;
use super::{ use super::{
components::{ components::{

View File

@ -17,9 +17,6 @@ use crate::transaction::{
Authorization, TransactionData, TransparentDigests, TxDigests, Authorization, TransactionData, TransparentDigests, TxDigests,
}; };
#[cfg(feature = "zfuture")]
use std::convert::TryInto;
#[cfg(feature = "zfuture")] #[cfg(feature = "zfuture")]
use zcash_encoding::{CompactSize, Vector}; use zcash_encoding::{CompactSize, Vector};

View File

@ -6,7 +6,6 @@ use aes::Aes256;
use blake2b_simd::Params as Blake2bParams; use blake2b_simd::Params as Blake2bParams;
use byteorder::{ByteOrder, LittleEndian, ReadBytesExt, WriteBytesExt}; use byteorder::{ByteOrder, LittleEndian, ReadBytesExt, WriteBytesExt};
use fpe::ff1::{BinaryNumeralString, FF1}; use fpe::ff1::{BinaryNumeralString, FF1};
use std::convert::TryInto;
use std::ops::AddAssign; use std::ops::AddAssign;
use subtle::{Choice, ConditionallySelectable}; use subtle::{Choice, ConditionallySelectable};

View File

@ -9,7 +9,8 @@ homepage = "https://github.com/zcash/librustzcash"
repository = "https://github.com/zcash/librustzcash" repository = "https://github.com/zcash/librustzcash"
readme = "README.md" readme = "README.md"
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2018" edition = "2021"
rust-version = "1.56.1"
categories = ["cryptography::cryptocurrencies"] categories = ["cryptography::cryptocurrencies"]
[package.metadata.docs.rs] [package.metadata.docs.rs]