Skip to content

Commit

Permalink
fix: Add missing forwardings for various methods.
Browse files Browse the repository at this point in the history
Not having these could lead to incorrect thoughput display.
  • Loading branch information
Byron committed Sep 6, 2023
1 parent 8f26902 commit 53ea2b8
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,18 @@ mod impls {
self.0.init(max, unit)
}

fn unit(&self) -> Option<Unit> {
self.0.unit()
}

fn max(&self) -> Option<Step> {
self.0.max()
}

fn set_max(&mut self, max: Option<Step>) -> Option<Step> {
self.0.set_max(max)
}

fn set_name(&mut self, name: String) {
self.0.set_name(name)
}
Expand All @@ -408,13 +420,33 @@ mod impls {
fn message(&self, level: MessageLevel, message: String) {
self.0.message(level, message)
}

fn show_throughput(&self, start: Instant) {
self.0.show_throughput(start)
}

fn show_throughput_with(&self, start: Instant, step: Step, unit: Unit, level: MessageLevel) {
self.0.show_throughput_with(start, step, unit, level)
}
}

impl Progress for BoxedProgress {
fn init(&mut self, max: Option<Step>, unit: Option<Unit>) {
self.deref_mut().init(max, unit)
}

fn unit(&self) -> Option<Unit> {
self.deref().unit()
}

fn max(&self) -> Option<Step> {
self.deref().max()
}

fn set_max(&mut self, max: Option<Step>) -> Option<Step> {
self.deref_mut().set_max(max)
}

fn set_name(&mut self, name: String) {
self.deref_mut().set_name(name)
}
Expand All @@ -430,6 +462,14 @@ mod impls {
fn message(&self, level: MessageLevel, message: String) {
self.deref().message(level, message)
}

fn show_throughput(&self, start: Instant) {
self.deref().show_throughput(start)
}

fn show_throughput_with(&self, start: Instant, step: Step, unit: Unit, level: MessageLevel) {
self.deref().show_throughput_with(start, step, unit, level)
}
}

impl Count for BoxedDynNestedProgress {
Expand Down Expand Up @@ -496,6 +536,18 @@ mod impls {
self.0.init(max, unit)
}

fn unit(&self) -> Option<Unit> {
self.0.unit()
}

fn max(&self) -> Option<Step> {
self.0.max()
}

fn set_max(&mut self, max: Option<Step>) -> Option<Step> {
self.0.set_max(max)
}

fn set_name(&mut self, name: String) {
self.0.set_name(name)
}
Expand All @@ -511,6 +563,14 @@ mod impls {
fn message(&self, level: MessageLevel, message: String) {
self.0.message(level, message)
}

fn show_throughput(&self, start: Instant) {
self.0.show_throughput(start)
}

fn show_throughput_with(&self, start: Instant, step: Step, unit: Unit, level: MessageLevel) {
self.0.show_throughput_with(start, step, unit, level)
}
}

impl<T> Count for DynNestedProgressToNestedProgress<T>
Expand Down

0 comments on commit 53ea2b8

Please sign in to comment.