-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Move non_send_fields_in_send_ty
to suspicious
#7874
Conversation
r? @llogiq (rust-highfive has picked a reviewer for you, use r? to override) |
c4d2de1
to
28a5b68
Compare
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.
Just one question, otherwise this looks good to me.
/// | ||
/// The list of unicode scripts allowed to be used in the scope. | ||
(allowed_scripts: Vec<String> = vec!["Latin".to_string()]), | ||
(allowed_scripts: Vec<String> = ["Latin"].iter().map(ToString::to_string).collect()), |
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.
I don't understand the reason for using an iterator here. What was wrong with using vec![_]
before?
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.
I remembered an old implementation, that would only display the content inside the square brackets to make the documentation a bit cleaner. Now it actually uses format!("{:?}", default_value)
which doesn't care about the formatting. The cases are therefore equivalent 😅
I would still suggest to switch it for consistency, as all other string vectors do the same. However, I'm also happy to revert this again 🙃
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.
Perhaps just add a comment that this test case also covers the distinction between vec!
and some_iter.collect()
so future reviewers don't have to wonder.
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.
We don't really have any test case for the metadata collecting 😅. However, I can update the "Add configuration" documentation to say that the default value will be formatted with format!("{:?}", default)
Also updated one configuration for nicer formatting
28a5b68
to
1ad04f4
Compare
Thank you! @bors r+ |
📌 Commit 1ad04f4 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Stabilize the
non_send_fields_in_send_ty
lint and update the lint for theallowed_scripts
configuration.closes: #7756
changelog: Move
non_send_fields_in_send_ty
tosuspicious