From f22cf9ce9bece87155e98202f65dbac0d269ddfb Mon Sep 17 00:00:00 2001 From: Dominik Korsa Date: Mon, 27 Nov 2023 18:39:45 +0100 Subject: [PATCH] Add links in iter.rs --- src/iter.rs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/iter.rs b/src/iter.rs index 73e83824..8861db52 100644 --- a/src/iter.rs +++ b/src/iter.rs @@ -19,9 +19,10 @@ pub trait ProgressIterator where Self: Sized + Iterator, { - /// Wrap an iterator with default styling. Uses `Iterator::size_hint` to get length. - /// Returns `Some(..)` only if `size_hint.1` is `Some`. If you want to create a progress bar - /// even if `size_hint.1` returns `None` use `progress_count` or `progress_with` instead. + /// Wrap an iterator with default styling. Uses [`Iterator::size_hint()`] to get length. + /// Returns `Some(..)` only if `size_hint.1` is [`Some`]. If you want to create a progress bar + /// even if `size_hint.1` returns [`None`] use [`progress_count()`](ProgressIterator::progress_count) + /// or [`progress_with()`](ProgressIterator::progress_with) instead. fn try_progress(self) -> Option> { self.size_hint() .1 @@ -66,7 +67,7 @@ pub struct ProgressBarIter { impl ProgressBarIter { /// Builder-like function for setting underlying progress bar's style. /// - /// See [`ProgressBar::with_style`]. + /// See [`ProgressBar::with_style()`]. pub fn with_style(mut self, style: ProgressStyle) -> Self { self.progress = self.progress.with_style(style); self @@ -74,7 +75,7 @@ impl ProgressBarIter { /// Builder-like function for setting underlying progress bar's prefix. /// - /// See [`ProgressBar::with_prefix`]. + /// See [`ProgressBar::with_prefix()`]. pub fn with_prefix(mut self, prefix: impl Into>) -> Self { self.progress = self.progress.with_prefix(prefix); self @@ -82,7 +83,7 @@ impl ProgressBarIter { /// Builder-like function for setting underlying progress bar's message. /// - /// See [`ProgressBar::with_message`]. + /// See [`ProgressBar::with_message()`]. pub fn with_message(mut self, message: impl Into>) -> Self { self.progress = self.progress.with_message(message); self @@ -90,7 +91,7 @@ impl ProgressBarIter { /// Builder-like function for setting underlying progress bar's position. /// - /// See [`ProgressBar::with_position`]. + /// See [`ProgressBar::with_position()`]. pub fn with_position(mut self, position: u64) -> Self { self.progress = self.progress.with_position(position); self @@ -98,7 +99,7 @@ impl ProgressBarIter { /// Builder-like function for setting underlying progress bar's elapsed time. /// - /// See [`ProgressBar::with_elapsed`]. + /// See [`ProgressBar::with_elapsed()`]. pub fn with_elapsed(mut self, elapsed: Duration) -> Self { self.progress = self.progress.with_elapsed(elapsed); self @@ -106,7 +107,7 @@ impl ProgressBarIter { /// Builder-like function for setting underlying progress bar's finish behavior. /// - /// See [`ProgressBar::with_finish`]. + /// See [`ProgressBar::with_finish()`]. pub fn with_finish(mut self, finish: ProgressFinish) -> Self { self.progress = self.progress.with_finish(finish); self