-
Notifications
You must be signed in to change notification settings - Fork 176
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
Conversation
match Collator::try_new(&provider, locale!("nb"), CollatorOptions::new()) { | ||
Ok(_) => panic!("Should fail to create 'nb' without fallback enabled"), | ||
Err(_) => (), | ||
}; |
There was a problem hiding this comment.
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
:
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"); |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
Fixes #1963