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 as_slice and as_mut_slice to Option #92411

Closed
wants to merge 3 commits into from
Closed

Add as_slice and as_mut_slice to Option #92411

wants to merge 3 commits into from

Commits on Dec 29, 2021

  1. Add as_slice and as_mut_slice to Option

    Extracts an immutable or mutable slice from an option such that, if
    the option is a None value, the slice is empty, and if the option
    is a Some value, the slice is length one.
    
    The slice is, for all practical purposes except extracting a
    pointer, a reference to the actual contents of the owned option. If
    it's a Some value, slice index zero contains the contents of the
    owned option. If it's a None value, the slice is length zero and
    cannot be read from or written to.
    ChaiTRex committed Dec 29, 2021
    Configuration menu
    Copy the full SHA
    44c670d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ac9bd88 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    02d4462 View commit details
    Browse the repository at this point in the history