Skip to content
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 Safety comments to unsafe blocks #2319

Merged
merged 2 commits into from
Nov 28, 2022
Merged

Add Safety comments to unsafe blocks #2319

merged 2 commits into from
Nov 28, 2022

Commits on Nov 9, 2022

  1. Make Buf::as_str private and unsafe, add safety docs

    serde::de::format::Buf is a private type, so this makes it explicit by
    declaring the type `pub(super)`. In addition, it marks the function
    `Buf::as_str` as unsafe, which lets us document the callsites with
    `// Safety: ...` comments to explain why it is safe to use.
    erickt committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    15ec95a View commit details
    Browse the repository at this point in the history
  2. Change comment to // Safety: ...

    This changes a comment to be explicit on how it's safe we can avoid
    validating UTF-8.
    erickt committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    1050f6b View commit details
    Browse the repository at this point in the history