Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix comment. #12

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kevincox
Copy link

The underlying method saturates. This comment was likely written with an old underlying implementation.


I was reading over the code to check for possible panics in Duration arithmetic and noticed this inconsistency in the comment. I may have misunderstood something but it seems that this just calls a method which saturates.

pub(crate) fn duration_since(&self, earlier: Instant) -> Duration {

/// # Panics
///
/// panics when `earlier` was later than `self`.
/// Returns `Duration::ZERO` when `earlier` was later than `self`.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems redundant now looking at line 51. 😅

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I really should have taken a holistic look at this comment rather than just deleting the bad bit. I think we can drop everything after the last line.

The underlying method saturates. This comment was likely written with an old underlying implementation.

Signed-off-by: Kevin Cox <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants