-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Closed
Copy link
Labels
A-ioArea: `std::io`, `std::fs`, `std::net` and `std::path`Area: `std::io`, `std::fs`, `std::net` and `std::path`T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Description
It's very common to use io::Error::new(kind, "some message")
, including in many places in std
. However, that will create a io::Error
containing a Repr::Custom
containing a Box<Custom>
containing a Box<dyn Error + ..>
containing a StringError
containing a String
containing a copy of the message. 🙃
Three allocations to just return an error message which is in some cases not even more helpful than just the ErrorKind, is not great. We should find a way to improve this.
Frago9876543210 and workingjubileebluss and workingjubilee
Metadata
Metadata
Assignees
Labels
A-ioArea: `std::io`, `std::fs`, `std::net` and `std::path`Area: `std::io`, `std::fs`, `std::net` and `std::path`T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.