Skip to content

Commit

Permalink
Remove redundant TryFrom/TryInto imports.
Browse files Browse the repository at this point in the history
  • Loading branch information
nuttycom committed Sep 2, 2022
1 parent 16a0e43 commit a93f594
Show file tree
Hide file tree
Showing 19 changed files with 0 additions and 32 deletions.
2 changes: 0 additions & 2 deletions components/zcash_encoding/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
use nonempty::NonEmpty;
use std::convert::TryFrom;
use std::io::{self, Read, Write};
use std::iter::FromIterator;

Expand Down Expand Up @@ -271,7 +270,6 @@ impl Optional {
#[cfg(test)]
mod tests {
use super::*;
use std::convert::{TryFrom, TryInto};
use std::fmt::Debug;

#[test]
Expand Down
2 changes: 0 additions & 2 deletions components/zcash_note_encryption/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ extern crate alloc;
#[cfg(feature = "alloc")]
use alloc::vec::Vec;

use core::convert::TryInto;

use chacha20::{
cipher::{NewCipher, StreamCipher, StreamCipherSeek},
ChaCha20,
Expand Down
2 changes: 0 additions & 2 deletions zcash_client_backend/examples/diversify-address.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::convert::TryInto;

use gumdrop::Options;
use zcash_client_backend::encoding::{decode_extended_full_viewing_key, encode_payment_address};
use zcash_primitives::{
Expand Down
1 change: 0 additions & 1 deletion zcash_client_backend/src/encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

use bech32::{self, Error, FromBase32, ToBase32, Variant};
use bs58::{self, decode::Error as Bs58Error};
use std::convert::TryInto;
use std::fmt;
use std::io::{self, Write};
use zcash_primitives::{
Expand Down
3 changes: 0 additions & 3 deletions zcash_client_backend/src/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ use zcash_primitives::{

use crate::address::UnifiedAddress;

#[cfg(feature = "transparent-inputs")]
use std::convert::TryInto;

#[cfg(feature = "transparent-inputs")]
use zcash_primitives::legacy::keys::{self as legacy, IncomingViewingKey};

Expand Down
1 change: 0 additions & 1 deletion zcash_client_backend/src/proto.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! Generated code for handling light client protobuf structs.

use ff::PrimeField;
use std::convert::{TryFrom, TryInto};

use zcash_primitives::{
block::{BlockHash, BlockHeader},
Expand Down
1 change: 0 additions & 1 deletion zcash_client_sqlite/src/wallet/transact.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! Functions for creating transactions.
//!
use rusqlite::{named_params, Row};
use std::convert::TryInto;

use ff::PrimeField;

Expand Down
2 changes: 0 additions & 2 deletions zcash_extensions/src/transparent/demo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
//! - `tx_b`: `[ TzeIn(tx_a, preimage_1) -> TzeOut(value, hash_2) ]`
//! - `tx_c`: `[ TzeIn(tx_b, preimage_2) -> [any output types...] ]`

use std::convert::TryFrom;
use std::convert::TryInto;
use std::fmt;
use std::ops::{Deref, DerefMut};

Expand Down
1 change: 0 additions & 1 deletion zcash_primitives/src/legacy/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use hdwallet::{ExtendedPrivKey, ExtendedPubKey, KeyIndex};
use ripemd::Digest as RipemdDigest;
use secp256k1::PublicKey;
use sha2::{Digest as Sha2Digest, Sha256};
use std::convert::TryInto;

use crate::{consensus, keys::prf_expand_vec, zip32::AccountId};

Expand Down
2 changes: 0 additions & 2 deletions zcash_primitives/src/memo.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! Structs for handling encrypted memos.

use std::cmp::Ordering;
use std::convert::{TryFrom, TryInto};
use std::error;
use std::fmt;
use std::ops::Deref;
Expand Down Expand Up @@ -275,7 +274,6 @@ impl str::FromStr for Memo {

#[cfg(test)]
mod tests {
use std::convert::TryInto;
use std::str::FromStr;

use super::{Error, Memo, MemoBytes};
Expand Down
2 changes: 0 additions & 2 deletions zcash_primitives/src/merkle_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use incrementalmerkletree::{
Altitude,
};
use std::collections::VecDeque;
use std::convert::TryFrom;
use std::io::{self, Read, Write};
use std::iter::repeat;
use zcash_encoding::{Optional, Vector};
Expand Down Expand Up @@ -620,7 +619,6 @@ impl<Node: Hashable> MerklePath<Node> {
mod tests {
use incrementalmerkletree::bridgetree::Frontier;
use proptest::prelude::*;
use std::convert::TryInto;
use std::io::{self, Read, Write};

use crate::sapling::{testing::arb_node, Node};
Expand Down
1 change: 0 additions & 1 deletion zcash_primitives/src/merkle_tree/incremental.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! Implementations of serialization and parsing for Orchard note commitment trees.

use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
use std::convert::{TryFrom, TryInto};
use std::io::{self, Read, Write};

use incrementalmerkletree::{
Expand Down
2 changes: 0 additions & 2 deletions zcash_primitives/src/sapling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ use incrementalmerkletree::{self, Altitude};
use lazy_static::lazy_static;
use rand_core::{CryptoRng, RngCore};
use std::array::TryFromSliceError;
use std::convert::{TryFrom, TryInto};
use std::io::{self, Read, Write};
use subtle::{Choice, ConstantTimeEq};

Expand Down Expand Up @@ -526,7 +525,6 @@ impl Note {
pub mod testing {
use proptest::prelude::*;
use std::cmp::min;
use std::convert::TryFrom;

use crate::{
transaction::components::amount::MAX_MONEY, zip32::testing::arb_extended_spending_key,
Expand Down
1 change: 0 additions & 1 deletion zcash_primitives/src/sapling/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
//!
//! [section 4.2.2]: https://zips.z.cash/protocol/protocol.pdf#saplingkeycomponents

use std::convert::TryInto;
use std::io::{self, Read, Write};

use crate::{
Expand Down
2 changes: 0 additions & 2 deletions zcash_primitives/src/sapling/note_encryption.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use ff::PrimeField;
use group::{cofactor::CofactorGroup, GroupEncoding};
use jubjub::{AffinePoint, ExtendedPoint};
use rand_core::RngCore;
use std::convert::TryInto;

use zcash_note_encryption::{
try_compact_note_decryption, try_note_decryption, try_output_recovery_with_ock,
Expand Down Expand Up @@ -474,7 +473,6 @@ mod tests {
use group::{cofactor::CofactorGroup, GroupEncoding};
use rand_core::OsRng;
use rand_core::{CryptoRng, RngCore};
use std::convert::TryInto;

use zcash_note_encryption::{
batch, EphemeralKeyBytes, NoteEncryption, OutgoingCipherKey, ENC_CIPHERTEXT_SIZE,
Expand Down
2 changes: 0 additions & 2 deletions zcash_primitives/src/transaction/components/sapling.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use core::fmt::Debug;
use std::convert::TryInto;

use ff::PrimeField;
use group::GroupEncoding;
Expand Down Expand Up @@ -429,7 +428,6 @@ pub mod testing {
use proptest::collection::vec;
use proptest::prelude::*;
use rand::{rngs::StdRng, SeedableRng};
use std::convert::TryFrom;

use crate::{
constants::{SPENDING_KEY_GENERATOR, VALUE_COMMITMENT_RANDOMNESS_GENERATOR},
Expand Down
1 change: 0 additions & 1 deletion zcash_primitives/src/transaction/sighash.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::legacy::Script;
use blake2b_simd::Hash as Blake2bHash;
use std::convert::TryInto;

use super::{
components::{
Expand Down
3 changes: 0 additions & 3 deletions zcash_primitives/src/transaction/sighash_v5.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ use crate::transaction::{
Authorization, TransactionData, TransparentDigests, TxDigests,
};

#[cfg(feature = "zfuture")]
use std::convert::TryInto;

#[cfg(feature = "zfuture")]
use zcash_encoding::{CompactSize, Vector};

Expand Down
1 change: 0 additions & 1 deletion zcash_primitives/src/zip32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use aes::Aes256;
use blake2b_simd::Params as Blake2bParams;
use byteorder::{ByteOrder, LittleEndian, ReadBytesExt, WriteBytesExt};
use fpe::ff1::{BinaryNumeralString, FF1};
use std::convert::TryInto;
use std::ops::AddAssign;
use subtle::{Choice, ConditionallySelectable};

Expand Down

0 comments on commit a93f594

Please sign in to comment.