From 92420fab6c937d93cc47319afd2995338e71dd58 Mon Sep 17 00:00:00 2001 From: funkill2 Date: Fri, 20 Sep 2019 17:19:38 +0300 Subject: [PATCH] added type alias rfc --- src/custom_types/enum.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/custom_types/enum.md b/src/custom_types/enum.md index 8580ce9f74..e861df9bfd 100644 --- a/src/custom_types/enum.md +++ b/src/custom_types/enum.md @@ -55,7 +55,7 @@ fn main() { ## Type aliases -If you use a type alias, you can refer to each enum variant via its alias. +If you use a type alias, you can refer to each enum variant via its alias. This might be useful if the enum's name is too long or too generic, and you want to rename it. @@ -93,16 +93,17 @@ impl VeryVerboseEnumOfThingsToDoWithNumbers { } ``` -To learn more about enums and type aliases, you can read the +To learn more about enums and type aliases, you can read the [stabilization report][aliasreport] from when this feature was stabilized into -Rust. +Rust. ### See also: -[`match`][match], [`fn`][fn], and [`String`][str], [] +[`match`][match], [`fn`][fn], and [`String`][str], ["Type alias enum variants" RFC][type_alias_rfc] [c_struct]: https://en.wikipedia.org/wiki/Struct_(C_programming_language) [match]: ../flow_control/match.md [fn]: ../fn.md [str]: ../std/str.md [aliasreport]: https://github.com/rust-lang/rust/pull/61682/#issuecomment-502472847 +[type_alias_rfc]: https://rust-lang.github.io/rfcs/2338-type-alias-enum-variants.html