Skip to content

Improve GenericArray Conversion Errors #167

@Enduriel

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.

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