Skip to content

fix: remove dead code, fix ns_comment remainder, and correct doc comments#241

Open
sumleo wants to merge 2 commits intorusticata:masterfrom
sumleo:fix/dead-code-cleanup
Open

fix: remove dead code, fix ns_comment remainder, and correct doc comments#241
sumleo wants to merge 2 commits intorusticata:masterfrom
sumleo:fix/dead-code-cleanup

Conversation

@sumleo
Copy link

@sumleo sumleo commented Feb 15, 2026

Summary

Three small fixes:

  1. Dead code in extension parser (extensions/mod.rs): Removed rem.take(rem.input_len()) which had no effect — take returns a new value without mutating rem, so the result was silently discarded

  2. Incorrect remainder in ns_comment fallback (extensions/ns_comment.rs): The fallback parser for non-IA5String-wrapped comments used input.take(input.input_len()) as the remainder, which returns the full input instead of an empty slice. Fixed to use input.take_from(input.input_len()) consistent with the pattern used in generalname.rs

  3. Wrong doc comments (certification_request.rs): Four doc comments on X509CertificationRequestInfo methods incorrectly referred to "CRL entry extensions" instead of "CSR attributes"

Test plan

  • Full test suite passes with cargo test --all-features

…ents

- Remove unused `rem.take(rem.input_len())` in extension parser that
  had no effect (take returns a new value without mutating rem)
- Fix ns_comment fallback parser to return empty remainder using
  take_from() instead of take(), which incorrectly returned the full
  input as the remainder
- Fix doc comments in X509CertificationRequestInfo that incorrectly
  referred to "CRL entry extensions" instead of "CSR attributes"
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.

1 participant