Skip to content

Commit 53ea2b8

Browse files
committed
fix: Add missing forwardings for various methods.
Not having these could lead to incorrect thoughput display.
1 parent 8f26902 commit 53ea2b8

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

src/traits.rs

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,18 @@ mod impls {
393393
self.0.init(max, unit)
394394
}
395395

396+
fn unit(&self) -> Option<Unit> {
397+
self.0.unit()
398+
}
399+
400+
fn max(&self) -> Option<Step> {
401+
self.0.max()
402+
}
403+
404+
fn set_max(&mut self, max: Option<Step>) -> Option<Step> {
405+
self.0.set_max(max)
406+
}
407+
396408
fn set_name(&mut self, name: String) {
397409
self.0.set_name(name)
398410
}
@@ -408,13 +420,33 @@ mod impls {
408420
fn message(&self, level: MessageLevel, message: String) {
409421
self.0.message(level, message)
410422
}
423+
424+
fn show_throughput(&self, start: Instant) {
425+
self.0.show_throughput(start)
426+
}
427+
428+
fn show_throughput_with(&self, start: Instant, step: Step, unit: Unit, level: MessageLevel) {
429+
self.0.show_throughput_with(start, step, unit, level)
430+
}
411431
}
412432

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

438+
fn unit(&self) -> Option<Unit> {
439+
self.deref().unit()
440+
}
441+
442+
fn max(&self) -> Option<Step> {
443+
self.deref().max()
444+
}
445+
446+
fn set_max(&mut self, max: Option<Step>) -> Option<Step> {
447+
self.deref_mut().set_max(max)
448+
}
449+
418450
fn set_name(&mut self, name: String) {
419451
self.deref_mut().set_name(name)
420452
}
@@ -430,6 +462,14 @@ mod impls {
430462
fn message(&self, level: MessageLevel, message: String) {
431463
self.deref().message(level, message)
432464
}
465+
466+
fn show_throughput(&self, start: Instant) {
467+
self.deref().show_throughput(start)
468+
}
469+
470+
fn show_throughput_with(&self, start: Instant, step: Step, unit: Unit, level: MessageLevel) {
471+
self.deref().show_throughput_with(start, step, unit, level)
472+
}
433473
}
434474

435475
impl Count for BoxedDynNestedProgress {
@@ -496,6 +536,18 @@ mod impls {
496536
self.0.init(max, unit)
497537
}
498538

539+
fn unit(&self) -> Option<Unit> {
540+
self.0.unit()
541+
}
542+
543+
fn max(&self) -> Option<Step> {
544+
self.0.max()
545+
}
546+
547+
fn set_max(&mut self, max: Option<Step>) -> Option<Step> {
548+
self.0.set_max(max)
549+
}
550+
499551
fn set_name(&mut self, name: String) {
500552
self.0.set_name(name)
501553
}
@@ -511,6 +563,14 @@ mod impls {
511563
fn message(&self, level: MessageLevel, message: String) {
512564
self.0.message(level, message)
513565
}
566+
567+
fn show_throughput(&self, start: Instant) {
568+
self.0.show_throughput(start)
569+
}
570+
571+
fn show_throughput_with(&self, start: Instant, step: Step, unit: Unit, level: MessageLevel) {
572+
self.0.show_throughput_with(start, step, unit, level)
573+
}
514574
}
515575

516576
impl<T> Count for DynNestedProgressToNestedProgress<T>

0 commit comments

Comments
 (0)