Skip to content

borsh::io::Error::new diverges from std::io::Error #342

Open
@kayabaNerve

Description

pub fn new<T: Into<String>>(kind: ErrorKind, error: T) -> Error {

https://docs.rs/borsh/latest/borsh/io/struct.Error.html#method.new

Into<String> vs Into<Box<dyn Error + Send + Sync>>.

I don't see a reason why it should be so specialized. This is technically a breaking change for the no-std API, as a type may impl Into<String> but not Into<Box<dyn Error>>, but I'd argue it as a bug fix.

I open this issue not for the hell of it, but because I did run into this while mapping borsh's no-std io to some work of my own.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions