Fix cargo clippy

This commit is contained in:
Daniela Brozzoni 2023-03-08 15:20:20 +01:00
parent 9d26121dbc
commit 47faa881fb
No known key found for this signature in database
GPG Key ID: 7DE4F1FDCED0AB87

View File

@ -62,7 +62,7 @@ use core::ops::RangeInclusive;
/// See the [module-level documentation] for more. /// See the [module-level documentation] for more.
/// ///
/// [module-level documentation]: crate::tx_graph /// [module-level documentation]: crate::tx_graph
#[derive(Clone, Debug, PartialEq)] #[derive(Clone, Debug, PartialEq, Default)]
pub struct TxGraph { pub struct TxGraph {
txs: HashMap<Txid, TxNode>, txs: HashMap<Txid, TxNode>,
spends: BTreeMap<OutPoint, HashSet<Txid>>, spends: BTreeMap<OutPoint, HashSet<Txid>>,
@ -72,16 +72,6 @@ pub struct TxGraph {
empty_outspends: HashSet<Txid>, empty_outspends: HashSet<Txid>,
} }
impl Default for TxGraph {
fn default() -> Self {
Self {
txs: Default::default(),
spends: Default::default(),
empty_outspends: Default::default(),
}
}
}
/// Node of a [`TxGraph`]. This can either be a whole transaction, or a partial transaction (where /// Node of a [`TxGraph`]. This can either be a whole transaction, or a partial transaction (where
/// we only have select outputs). /// we only have select outputs).
#[derive(Clone, Debug, PartialEq)] #[derive(Clone, Debug, PartialEq)]
@ -423,7 +413,7 @@ impl TxGraph {
/// Refer to [module-level documentation] for more. /// Refer to [module-level documentation] for more.
/// ///
/// [module-level documentation]: crate::tx_graph /// [module-level documentation]: crate::tx_graph
#[derive(Debug, Clone, PartialEq)] #[derive(Debug, Clone, PartialEq, Default)]
#[cfg_attr( #[cfg_attr(
feature = "serde", feature = "serde",
derive(serde::Deserialize, serde::Serialize), derive(serde::Deserialize, serde::Serialize),
@ -462,15 +452,6 @@ impl Additions {
} }
} }
impl Default for Additions {
fn default() -> Self {
Self {
tx: Default::default(),
txout: Default::default(),
}
}
}
impl AsRef<TxGraph> for TxGraph { impl AsRef<TxGraph> for TxGraph {
fn as_ref(&self) -> &TxGraph { fn as_ref(&self) -> &TxGraph {
self self