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 str pointer methods (take 2) #91218

Closed

Commits on Dec 7, 2021

  1. Add const_str_ptr and mut_str_ptr lang items

    These items allow to make inherent impls for `*const str` and `*mut str`.
    WaffleLapkin committed Dec 7, 2021
    Configuration menu
    Copy the full SHA
    e15212f View commit details
    Browse the repository at this point in the history

Commits on Dec 17, 2021

  1. Add raw str methods

    This patch adds the following methods to `*const str` and `*mut str`:
    - `len`
    - `as_ptr` (`as_mut_ptr`)
    - `get_unchecked` (`get_unchecked_mut`)
    
    Similar methods have already existed for raw slices.
    WaffleLapkin committed Dec 17, 2021
    Configuration menu
    Copy the full SHA
    8ee7afe View commit details
    Browse the repository at this point in the history
  2. Add nonnull raw str methods

    This patch adds the following methods to `NonNull<str>`:
    - `len`
    - `as_non_null_ptr`
    - `as_mut_ptr`
    - `get_unchecked_mut`
    
    Similar methods have already existed for raw slices, raw strings and nonnull
    raw slices.
    WaffleLapkin committed Dec 17, 2021
    Configuration menu
    Copy the full SHA
    fd3fb2e View commit details
    Browse the repository at this point in the history
  3. Adjust documentation for some pointer-to-slice methods

    This commit changes documentation of the following methods as proposed
    by the PR review
    - `<*const [T]>::len`
    - `<*mut [T]>::len`
    - `<*const str>::len`
    - `<*mut str>::len`
    - `<*const str>::get_unchecked`
    - `<*mut str>::get_unchecked_mut`
    - `NonNull::<str>::get_unchecked_mut`
    WaffleLapkin committed Dec 17, 2021
    Configuration menu
    Copy the full SHA
    bb73eab View commit details
    Browse the repository at this point in the history