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

num2words: linting and -th ordinal_num fix for en #20

Merged
merged 2 commits into from
Dec 12, 2023

Conversation

pavloslav
Copy link
Contributor

@pavloslav pavloslav commented Nov 27, 2023

Closes #15, closes #16

Copy link
Owner

@Ballasi Ballasi left a comment

Choose a reason for hiding this comment

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

Just a little thing on the unit test, the rest looks good to me!

src/num2words.rs Outdated
match Num2Words::parse("not a number") {
Some(_) => assert!(false),
None => assert!(true),
if Num2Words::parse("not a number").is_some() {
Copy link
Owner

Choose a reason for hiding this comment

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

LGTM on most side here, I am just not a huge fan of the idea of using panic which will 1. stop the unit tests here, without running the other ones and 2. don't report anything if it works.

The following should do a better job:

assert!(Num2Words::parse("not a number").is_none());
assert!(Num2Words::parse("NAN").is_none());

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Owner

Choose a reason for hiding this comment

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

Related comment for tracking: a109dbc#r133143809

@pavloslav
Copy link
Contributor Author

Fixed

@Ballasi Ballasi changed the title Small impovements: EN teen endings (th); lints num2words: linting and -th ordinal_num fix for en Dec 12, 2023
@Ballasi Ballasi merged commit a57bc21 into Ballasi:master Dec 12, 2023
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.

A number of clippy lints all over the code ordinal_num for English wrong with teens
2 participants