Skip to content

Commit 3b91b7a

Browse files
Nadrierildianne
authored andcommitted
Make cow_of_cow test a teeny bit more explicit
1 parent 93d13e9 commit 3b91b7a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/ui/pattern/deref-patterns/implicit-cow-deref.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use std::borrow::Cow;
77

88
fn main() {
9-
let cow: Cow<'static, [u8]> = Cow::from(&[1, 2, 3]);
9+
let cow: Cow<'static, [u8]> = Cow::Borrowed(&[1, 2, 3]);
1010

1111
match cow {
1212
[..] => {}
@@ -31,6 +31,7 @@ fn main() {
3131
_ => unreachable!(),
3232
}
3333

34+
// This matches on the outer `Cow` (the owned one).
3435
match cow_of_cow {
3536
Cow::Borrowed(_) => unreachable!(),
3637
Cow::Owned(_) => {}

0 commit comments

Comments
 (0)