Skip to content

Conversation

@ada4a
Copy link
Contributor

@ada4a ada4a commented Jan 12, 2026

The vague "or" was a bit silly

changelog: [strlen_on_c_strings]: mention the specific type (CString or CStr)
changelog: [strlen_on_c_strings]: lint all types that dereference to CStr

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jan 12, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 12, 2026

r? @samueltardieu

rustbot has assigned @samueltardieu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@ada4a ada4a force-pushed the strlen_on_c_strings branch from 9c58080 to f36c4f9 Compare January 12, 2026 18:42
@samueltardieu
Copy link
Member

Nit: should we use "use ... instead"(or just "use") instead of "try"?

ada4a added 3 commits January 12, 2026 20:53
early-return earlier, and create suggestion-related things later
For simplicity's sake, this also changes the lint to always suggest
`to_bytes`, as it is somewhat hard to find out whether a type could
dereference to `CString` (which is what `as_bytes` would require)
@ada4a ada4a force-pushed the strlen_on_c_strings branch from f36c4f9 to 49c8614 Compare January 12, 2026 19:55
@ada4a
Copy link
Contributor Author

ada4a commented Jan 12, 2026

Given that this is an autofix.. yeah probably. Repeating the whole .to_bytes().len() thing would be repetetive though imo, so I went with just "use"

@samueltardieu samueltardieu added this pull request to the merge queue Jan 12, 2026
Merged via the queue into rust-lang:master with commit c267b59 Jan 12, 2026
11 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jan 12, 2026
@samueltardieu
Copy link
Member

@ada4a I hadn't noticed that you opened this PR right after you commented on #16323 which is a first contribution. It would have been nice to mention that, or better, to have waited until #16323 is merged. That would have made it easier for this new contributor.

@ada4a
Copy link
Contributor Author

ada4a commented Jan 13, 2026

Yeah that was a weird brain hiccup – I did realize that this would cause a conflict, and did want to avoid it... but just didn't. Apologies to you and @Tigls, I'll do better next time

@ada4a ada4a deleted the strlen_on_c_strings branch January 13, 2026 09:18
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.

3 participants