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 Norwegian collator test #2250

Merged
merged 2 commits into from
Jul 27, 2022
Merged

Add Norwegian collator test #2250

merged 2 commits into from
Jul 27, 2022

Conversation

sffc
Copy link
Member

@sffc sffc commented Jul 26, 2022

Fixes #1963

@sffc sffc requested review from a team, robertbastian and Manishearth as code owners July 26, 2022 02:28
robertbastian
robertbastian previously approved these changes Jul 27, 2022
Comment on lines 213 to 216
match Collator::try_new(&provider, locale!("nb"), CollatorOptions::new()) {
Ok(_) => panic!("Should fail to create 'nb' without fallback enabled"),
Err(_) => (),
};
Copy link
Member

Choose a reason for hiding this comment

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

Clippy wants to make this an if let, but you can use expect_err:

Suggested change
match Collator::try_new(&provider, locale!("nb"), CollatorOptions::new()) {
Ok(_) => panic!("Should fail to create 'nb' without fallback enabled"),
Err(_) => (),
};
Collator::try_new(&provider, locale!("nb"), CollatorOptions::new())
.expect_err("Should fail to create 'nb' without fallback enabled");

Copy link
Member Author

Choose a reason for hiding this comment

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

expect_err didn't work because Collator does not implement Debug (and I'm not interested in scope-creeping this PR to add such an impl)

Copy link
Member

Choose a reason for hiding this comment

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

Understandable, although I believe we've said that all public types should be Debug, another thing we need to track before 1.0...

Copy link
Member Author

Choose a reason for hiding this comment

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

Is there a way to track this with Clippy or some other way?

Copy link
Member

Choose a reason for hiding this comment

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

There's a missing_debug_implementations rustc lint

@sffc sffc merged commit 10f9ea4 into unicode-org:main Jul 27, 2022
@sffc sffc deleted the no-nb branch July 27, 2022 16:39
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.

Ensure that the provider performs correct Norwegian macrolanguage fallback
3 participants