Skip to content

Improve GenericArray Conversion Errors #167

Description

@Enduriel

Currently LengthError doesn't return the expected vs actual lengths.

Changing this would be a semver breaking change, but downstream it is useful to have this information for logging purposes, the current work around is to store the length first which feels unnecessary and isn't as clean.

Alternatively, functions like GenericArray::try_from_vec could return the Vec itself on error (I think this is a better approach and follows std conventions) which would allow consumers to either use them in a different way or to create their own error at that point.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions