Add Cow<str> -> Box<Error> impls.#44466
Conversation
|
(rust_highfive has picked a reviewer for you, use r? to override) |
|
Seems reasonable to me @rfcbot fcp merge |
|
Team member @alexcrichton has proposed to merge this. The next step is review by the rest of the tagged teams: No concerns currently listed. Once these reviewers reach consensus, this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
src/libstd/error.rs
Outdated
There was a problem hiding this comment.
Needs to import Cow.
[00:03:22] error[E0412]: cannot find type `Cow` in this scope
[00:03:22] --> /checkout/src/libstd/error.rs:221:19
[00:03:22] |
[00:03:22] 221 | impl<'a, 'b> From<Cow<'b, str>> for Box<Error + Send + Sync + 'a> {
[00:03:22] | ^^^ not found in this scope
[00:03:22] |
[00:03:22] help: possible candidate is found in another module, you can import it into scope
[00:03:22] |
[00:03:22] 66 | use alloc::borrow::Cow;There was a problem hiding this comment.
That was a silly error. Fixed.
b0adb44 to
778d5f2
Compare
|
🔔 This is now entering its final comment period, as per the review above. 🔔 |
|
@bors: r+ |
|
📌 Commit 778d5f2 has been approved by |
Add Cow<str> -> Box<Error> impls. Considering how impls exist for `String` and `&str`, it makes sense to also add an impl for `Cow<str>` as well. This would allow converting `String::from_utf8_lossy` directly into a `Box<Error>` or `io::Error` without having to add an extra `into_ownd()`.
Add Cow<str> -> Box<Error> impls. Considering how impls exist for `String` and `&str`, it makes sense to also add an impl for `Cow<str>` as well. This would allow converting `String::from_utf8_lossy` directly into a `Box<Error>` or `io::Error` without having to add an extra `into_ownd()`.
Considering how impls exist for
Stringand&str, it makes sense to also add an impl forCow<str>as well.This would allow converting
String::from_utf8_lossydirectly into aBox<Error>orio::Errorwithout having to add an extrainto_ownd().