Conversation
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
|
r? libs-api |
dtolnay
left a comment
There was a problem hiding this comment.
Thanks for the PR!
Before I put this to FCP, would you be able to share some example code in which doing this conversion generically using From is useful? Usually I'd expect what you showed to be written as:
Cow::Borrowed::<[i32]>(&[1, 1, 2, 3, 5, 8])or:
Cow::Borrowed(&[1, 1, 2, 3, 5, 8] as &[i32])|
Its supposed to fix I think its still useful though, if only because it saves you a rewrite when you do it (dont have to change it to Is |
|
I would say, yes, The impls exists in support of generic code like this: rust/compiler/rustc_errors/src/diagnostic.rs Lines 974 to 981 in 1dfb6b1 where they enable different callers to efficiently pass a variety of different types for the |
|
Wont this help, there, then? |
Co-authored-by: zachs18 <8355914+zachs18@users.noreply.github.com>
|
CC #113489 |
enables
as well as
References #116890