From d4ee08bd19feb8581e1a508b3ee63c4deb9152f4 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Fri, 22 Oct 2021 10:37:00 +1100 Subject: [PATCH] Remove all usages of `#[allow(dead_code)]` This is a legacy from not having a library crate. --- daemon/src/bitmex_price_feed.rs | 2 -- daemon/src/db.rs | 2 -- daemon/src/model/cfd.rs | 7 ------- daemon/src/oracle.rs | 1 - daemon/src/seed.rs | 1 - 5 files changed, 13 deletions(-) diff --git a/daemon/src/bitmex_price_feed.rs b/daemon/src/bitmex_price_feed.rs index 0c0a2f2..56a847d 100644 --- a/daemon/src/bitmex_price_feed.rs +++ b/daemon/src/bitmex_price_feed.rs @@ -68,12 +68,10 @@ impl Quote { })) } - #[allow(dead_code)] // Not used by all binaries. pub fn for_maker(&self) -> Usd { self.ask } - #[allow(dead_code)] // Not used by all binaries. pub fn for_taker(&self) -> Usd { // TODO: verify whether this is correct self.mid_range().unwrap() diff --git a/daemon/src/db.rs b/daemon/src/db.rs index c1cf5ce..0d96ddf 100644 --- a/daemon/src/db.rs +++ b/daemon/src/db.rs @@ -188,7 +188,6 @@ pub async fn append_cfd_state(cfd: &Cfd, conn: &mut PoolConnection) -> a Ok(()) } -#[allow(dead_code)] async fn load_cfd_id_by_order_uuid( order_uuid: OrderId, conn: &mut PoolConnection, @@ -210,7 +209,6 @@ async fn load_cfd_id_by_order_uuid( Ok(cfd_id) } -#[allow(dead_code)] async fn load_latest_cfd_state( cfd_id: i64, conn: &mut PoolConnection, diff --git a/daemon/src/model/cfd.rs b/daemon/src/model/cfd.rs index ca10583..9df889b 100644 --- a/daemon/src/model/cfd.rs +++ b/daemon/src/model/cfd.rs @@ -124,7 +124,6 @@ pub struct Order { pub oracle_event_id: BitMexPriceEventId, } -#[allow(dead_code)] // Only one binary and the tests use this. impl Order { pub const TERM: Duration = Duration::hours(24); @@ -581,7 +580,6 @@ pub struct RollOverProposal { } #[derive(Debug, Clone)] -#[allow(dead_code)] // Variants (for now) used by different binaries. pub enum SettlementKind { Incoming, Outgoing, @@ -684,7 +682,6 @@ impl Cfd { } } - #[allow(dead_code)] pub fn refund_timelock_in_blocks(&self) -> u32 { (self.order.term * Cfd::REFUND_THRESHOLD).as_blocks().ceil() as u32 } @@ -701,10 +698,8 @@ impl Cfd { /// The downside is that if the oracle disappears: the users would only notice at the end /// of the cfd term. In this case the users has to wait for another `1.5` times of the /// term to get his funds back. - #[allow(dead_code)] const REFUND_THRESHOLD: f32 = 1.5; - #[allow(dead_code)] pub const CET_TIMELOCK: u32 = 12; pub fn handle(&mut self, event: CfdStateChangeEvent) -> Result> { @@ -1292,7 +1287,6 @@ pub struct NotReadyYet { } #[derive(Debug, Clone)] -#[allow(dead_code)] // Not all variants are used by all binaries. pub enum CfdStateChangeEvent { // TODO: group other events by actors into enums and add them here so we can bundle all // transitions into cfd.transition_to(...) @@ -1718,7 +1712,6 @@ impl Dlc { Ok((tx, sig)) } - #[allow(dead_code)] // Used only by the maker. pub fn finalize_spend_transaction( &self, (close_tx, own_sig): (Transaction, Signature), diff --git a/daemon/src/oracle.rs b/daemon/src/oracle.rs index c95cfb6..fffb7c3 100644 --- a/daemon/src/oracle.rs +++ b/daemon/src/oracle.rs @@ -257,7 +257,6 @@ impl xtra::Handler for Actor { } } -#[allow(dead_code)] pub fn next_announcement_after(timestamp: OffsetDateTime) -> Result { let adjusted = ceil_to_next_hour(timestamp)?; diff --git a/daemon/src/seed.rs b/daemon/src/seed.rs index e14787e..8eaaa9f 100644 --- a/daemon/src/seed.rs +++ b/daemon/src/seed.rs @@ -63,7 +63,6 @@ impl Seed { Ok(ext_priv_key) } - #[allow(dead_code)] // Not used by all binaries. pub fn derive_auth_password>(&self) -> P { let mut password = [0u8; 32];