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

Add blank and negated + small adjustments #17

Merged
merged 3 commits into from
Feb 8, 2024
Merged

Conversation

nekevss
Copy link
Member

@nekevss nekevss commented Feb 8, 2024

Related to #11

Primarily implementing blank and negated functionality onto blank.

Renames: duration_sign -> sign

Comment on lines 867 to 870
/// Returns whether the current `Duration` is blank.
pub fn blank(&self) -> bool {
duration_sign(&self.iter().collect()) == 0
}
Copy link
Member

Choose a reason for hiding this comment

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

Would probably be better to name this is_zero, I think.

Copy link
Member

Choose a reason for hiding this comment

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

I was more talking about the function itself, since duration_sign returns zero only when self is zero.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, I'm blind lol yeah, that can work too.

Copy link
Member Author

Choose a reason for hiding this comment

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

Glancing back through old temporal meeting minutes. It used to be called isZero but was opted off of, but I see no reason to not go with isZero as long as the equivalency is noted.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, blank is not very descriptive IMHO. We can add some comments when we rename spec methods just like in Boa.

Copy link
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

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

LGTM!

@jedel1043 jedel1043 merged commit 5c791ca into main Feb 8, 2024
5 checks passed
@jedel1043 jedel1043 deleted the duration-methods-update branch February 8, 2024 04:33
@jedel1043 jedel1043 added the C-enhancement New feature or request label Feb 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants