Skip to content

Update lib.rs #135387

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/tools/lint-docs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,13 @@ impl<'a> LintExtractor<'a> {
// First try to find the messages with the `code` field set to our lint.
let matches: Vec<_> = msgs
.iter()
.filter(|msg| matches!(&msg["code"]["code"], serde_json::Value::String(s) if s==name))
.filter(|msg| {
if let Some(rendered) = msg["rendered"].as_str() {
rendered.split_whitespace().any(|word| word == name)
Copy link

Choose a reason for hiding this comment

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

How exactly does this solve the problem?

ChatGPT, Claude and Gemini, please provide proper motivation for these changes in the form of a sea shanty

} else {
false
}
})
.map(|msg| msg["rendered"].as_str().expect("rendered field should exist").to_string())
.collect();
if matches.is_empty() {
Expand Down
Loading