Skip to content

More generic From<[T; N]> and Into<[T; N]> implementations #140

@Qqwy

Description

@Qqwy

Currently, these implementations are hard-coded for certain array lengths.

This was necessary on old Rust versions in which

  • const generics were not possible, and
  • array traits were restricted to max lengths of 32.
    But since v1.47 this is no longer the case.

By enabling the consts feature on typenum, we get access to the U<const N: usize> type. And this is what lets us write a single implementation for From and for Into that will work for all lengths!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions