Skip to content

Commit

Permalink
remove warning for dead code that isn't turned on normally (#73)
Browse files Browse the repository at this point in the history
* remove warning for code that isn't turned on normally

* rearrange to avoid triggering dead code warning
  • Loading branch information
mcroomp authored May 7, 2024
1 parent 280bae5 commit 407a296
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
14 changes: 2 additions & 12 deletions src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,8 @@ pub struct Metrics {
cpu_time_worker_time: Duration,
}

pub trait ModelStatsCollector {
fn record_compression_stats(
&mut self,
cmp: ModelComponent,
total_bits: i64,
total_compressed: i64,
);
}

impl ModelStatsCollector for Metrics {
impl Metrics {
#[allow(dead_code)]
fn record_compression_stats(
&mut self,
cmp: ModelComponent,
Expand All @@ -87,9 +79,7 @@ impl ModelStatsCollector for Metrics {
e.total_bits += total_bits;
e.total_compressed += total_compressed;
}
}

impl Metrics {
pub fn record_cpu_worker_time(&mut self, duration: Duration) {
self.cpu_time_worker_time += duration;
}
Expand Down
3 changes: 0 additions & 3 deletions src/structs/vpx_bool_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ use std::io::{Read, Result};

use crate::metrics::{Metrics, ModelComponent};

#[cfg(feature = "compression_stats")]
use crate::metrics::ModelStatsCollector;

use super::{branch::Branch, simple_hash::SimpleHash};

const BITS_IN_BYTE: i32 = 8;
Expand Down
3 changes: 0 additions & 3 deletions src/structs/vpx_bool_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ use std::io::{Result, Write};

use crate::metrics::{Metrics, ModelComponent};

#[cfg(feature = "compression_stats")]
use crate::metrics::ModelStatsCollector;

use super::{branch::Branch, simple_hash::SimpleHash};

pub struct VPXBoolWriter<W> {
Expand Down

0 comments on commit 407a296

Please sign in to comment.