From 9af125d6a5af76abdb5975d3bd815132ed88d073 Mon Sep 17 00:00:00 2001 From: arvidn Date: Fri, 23 Feb 2024 13:00:45 +0100 Subject: [PATCH] fix clippy warnings --- chia-bls/fuzz/fuzz_targets/blspy-fidelity.rs | 1 - chia-bls/src/mnemonic.rs | 1 - chia-bls/src/signature.rs | 1 - chia-protocol/fuzz/fuzz_targets/spend-bundle.rs | 1 - chia-protocol/src/bytes.rs | 1 - chia-protocol/src/coin.rs | 1 - chia-protocol/src/spend_bundle.rs | 1 - chia-traits/src/int.rs | 5 ++--- chia-traits/src/streamable.rs | 1 - src/gen/get_puzzle_and_solution.rs | 1 - wheel/src/api.rs | 5 +---- wheel/src/compression.rs | 2 -- 12 files changed, 3 insertions(+), 18 deletions(-) diff --git a/chia-bls/fuzz/fuzz_targets/blspy-fidelity.rs b/chia-bls/fuzz/fuzz_targets/blspy-fidelity.rs index ac19af03c..825bbf621 100644 --- a/chia-bls/fuzz/fuzz_targets/blspy-fidelity.rs +++ b/chia-bls/fuzz/fuzz_targets/blspy-fidelity.rs @@ -9,7 +9,6 @@ #![no_main] use libfuzzer_sys::fuzz_target; use pyo3::prelude::*; -use std::convert::TryFrom; use chia_bls::derivable_key::DerivableKey; use chia_bls::secret_key::SecretKey; diff --git a/chia-bls/src/mnemonic.rs b/chia-bls/src/mnemonic.rs index 79051325b..cebc9698d 100644 --- a/chia-bls/src/mnemonic.rs +++ b/chia-bls/src/mnemonic.rs @@ -1,7 +1,6 @@ use anyhow::Error; use bip39::{Language, Mnemonic, Seed}; use std::array::TryFromSliceError; -use std::result::Result; pub fn entropy_to_mnemonic(entropy: &[u8; 32]) -> String { Mnemonic::from_entropy(entropy, Language::English) diff --git a/chia-bls/src/signature.rs b/chia-bls/src/signature.rs index eceb8d603..daf878bed 100644 --- a/chia-bls/src/signature.rs +++ b/chia-bls/src/signature.rs @@ -3,7 +3,6 @@ use blst::*; use chia_traits::{read_bytes, Streamable}; use sha2::{Digest, Sha256}; use std::borrow::Borrow; -use std::convert::AsRef; use std::fmt; use std::hash::{Hash, Hasher}; use std::io::Cursor; diff --git a/chia-protocol/fuzz/fuzz_targets/spend-bundle.rs b/chia-protocol/fuzz/fuzz_targets/spend-bundle.rs index 08a38c6d1..302b293f6 100644 --- a/chia-protocol/fuzz/fuzz_targets/spend-bundle.rs +++ b/chia-protocol/fuzz/fuzz_targets/spend-bundle.rs @@ -9,7 +9,6 @@ use clvmr::ENABLE_FIXED_DIV; use clvmr::{Allocator, NodePtr}; use libfuzzer_sys::fuzz_target; use std::collections::HashSet; -use std::iter::FromIterator; fuzz_target!(|data: &[u8]| { let Ok(bundle) = SpendBundle::from_bytes(data) else { diff --git a/chia-protocol/src/bytes.rs b/chia-protocol/src/bytes.rs index a1c15efe2..8a0245604 100644 --- a/chia-protocol/src/bytes.rs +++ b/chia-protocol/src/bytes.rs @@ -2,7 +2,6 @@ use chia_traits::{chia_error, read_bytes, Streamable}; use clvm_traits::{ClvmDecoder, ClvmEncoder, FromClvm, FromClvmError, ToClvm, ToClvmError}; use sha2::{Digest, Sha256}; use std::array::TryFromSliceError; -use std::convert::{AsRef, TryInto}; use std::fmt; use std::io::Cursor; use std::ops::Deref; diff --git a/chia-protocol/src/coin.rs b/chia-protocol/src/coin.rs index 40e2d752d..64f80f664 100644 --- a/chia-protocol/src/coin.rs +++ b/chia-protocol/src/coin.rs @@ -6,7 +6,6 @@ use clvm_traits::{ ToClvm, ToClvmError, }; use sha2::{Digest, Sha256}; -use std::convert::TryInto; #[cfg(feature = "py-bindings")] use pyo3::prelude::*; diff --git a/chia-protocol/src/spend_bundle.rs b/chia-protocol/src/spend_bundle.rs index 94ad3f483..241feb832 100644 --- a/chia-protocol/src/spend_bundle.rs +++ b/chia-protocol/src/spend_bundle.rs @@ -11,7 +11,6 @@ use clvmr::cost::Cost; use clvmr::op_utils::{first, rest}; use clvmr::reduction::EvalErr; use clvmr::Allocator; -use std::result::Result; #[cfg(feature = "py-bindings")] use pyo3::prelude::*; diff --git a/chia-traits/src/int.rs b/chia-traits/src/int.rs index 752c03d38..2c4334223 100644 --- a/chia-traits/src/int.rs +++ b/chia-traits/src/int.rs @@ -1,6 +1,5 @@ -use pyo3::prelude::*; -use pyo3::types::{PyAny, PyBool, PyList, PyString, PyTuple}; -use pyo3::PyResult; +use pyo3::types::{PyAny, PyBool, PyList, PyModule, PyString, PyTuple}; +use pyo3::{IntoPy, PyResult, Python}; /// A custom to-python conversion trait that turns primitive integer types into /// the chia-blockchain fixed-width integer types (uint8, int8, etc.) diff --git a/chia-traits/src/streamable.rs b/chia-traits/src/streamable.rs index 496b11ad7..f87dda4f3 100644 --- a/chia-traits/src/streamable.rs +++ b/chia-traits/src/streamable.rs @@ -1,6 +1,5 @@ use crate::chia_error::{Error, Result}; use sha2::{Digest, Sha256}; -use std::convert::TryInto; use std::io::Cursor; use std::mem::size_of; diff --git a/src/gen/get_puzzle_and_solution.rs b/src/gen/get_puzzle_and_solution.rs index 01d0be0e6..ec4539ec2 100644 --- a/src/gen/get_puzzle_and_solution.rs +++ b/src/gen/get_puzzle_and_solution.rs @@ -3,7 +3,6 @@ use ::chia_protocol::bytes::Bytes32; use clvm_utils::tree_hash; use clvmr::allocator::{Allocator, Atom, NodePtr}; use clvmr::op_utils::u64_from_bytes; -use std::convert::AsRef; // returns parent-coin ID, amount, puzzle-reveal and solution pub fn parse_coin_spend( diff --git a/wheel/src/api.rs b/wheel/src/api.rs index 31fa8735e..ec1e90cb9 100644 --- a/wheel/src/api.rs +++ b/wheel/src/api.rs @@ -40,13 +40,10 @@ use clvmr::{ENABLE_BLS_OPS_OUTSIDE_GUARD, ENABLE_FIXED_DIV, LIMIT_HEAP, NO_UNKNO use pyo3::buffer::PyBuffer; use pyo3::exceptions::PyRuntimeError; use pyo3::prelude::*; -use pyo3::types::PyAny; use pyo3::types::PyBytes; use pyo3::types::PyList; -use pyo3::types::PyModule; use pyo3::types::PyTuple; -use pyo3::{wrap_pyfunction, PyResult, Python}; -use std::convert::TryInto; +use pyo3::wrap_pyfunction; use std::iter::zip; use crate::run_program::{run_chia_program, serialized_length}; diff --git a/wheel/src/compression.rs b/wheel/src/compression.rs index 46ad262ae..66c66a5fd 100644 --- a/wheel/src/compression.rs +++ b/wheel/src/compression.rs @@ -1,8 +1,6 @@ use chia::compression::compressor::create_autoextracting_clvm_program; use pyo3::prelude::*; use pyo3::types::PyBytes; -use pyo3::types::PyModule; -use pyo3::{wrap_pyfunction, PyResult, Python}; #[pyfunction] fn create_compressed_generator<'p>(py: Python<'p>, input_program: &[u8]) -> PyResult<&'p PyBytes> {