Skip to content

Is there a way to convert a SmallVec<A> into an A? #85

Description

@sunshowers

I have need for a variable-length array that is almost always exactly length 32 -- so I'd like to represent it as a SmallVec<[T; 32]>. I'd like to convert it to a [T; 32] without copying. It would be cool to add a method that can try doing the conversion if possible and returns the original SmallVec if it didn't work out:

fn into_array(self) -> Result<A, Self>

What do you think?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions