We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 8f6b7a6 + aa04f92 commit 9913d7bCopy full SHA for 9913d7b
src/custom_types/enum/testcase_linked_list.md
@@ -32,6 +32,9 @@ impl List {
32
// depends on the variant of `self`
33
// `self` has type `&List`, and `*self` has type `List`, matching on a
34
// concrete type `T` is preferred over a match on a reference `&T`
35
+ // after Rust 2018 you can use self here and tail (with no ref) below as well,
36
+ // rust will infer &s and ref tail.
37
+ // See https://doc.rust-lang.org/edition-guide/rust-2018/ownership-and-lifetimes/default-match-bindings.html
38
match *self {
39
// Can't take ownership of the tail, because `self` is borrowed;
40
// instead take a reference to the tail
0 commit comments