From 4471b0efbc1d80074de0305b0c5df322f8419a5a Mon Sep 17 00:00:00 2001 From: "Havvy (Ryan Scheel)" Date: Sun, 14 Feb 2021 12:26:59 -0800 Subject: [PATCH] Address review comments w.r.t. remove enum variant expr --- book.toml | 3 +++ src/expressions/struct-expr.md | 7 +++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/book.toml b/book.toml index b1335de..d57c9a1 100644 --- a/book.toml +++ b/book.toml @@ -6,3 +6,6 @@ author = "The Rust Project Developers" [output.html] additional-css = ["theme/reference.css"] git-repository-url = "https://github.com/rust-lang/reference/" + +[output.html.redirect] +"/expressions/enum-variant-expr.html" = "struct-expr.html" \ No newline at end of file diff --git a/src/expressions/struct-expr.md b/src/expressions/struct-expr.md index 5179046..31689bd 100644 --- a/src/expressions/struct-expr.md +++ b/src/expressions/struct-expr.md @@ -28,7 +28,7 @@ > _StructExprUnit_ : [_PathInExpression_] A *struct expression* creates a struct, enum, or union value. -It consists of a path to a [struct], [enum], or [union] item followed by the values for the fields of the item. +It consists of a path to a [struct], [enum variant], or [union] item followed by the values for the fields of the item. There are three forms of struct expressions: struct, tuple, and unit. The following are examples of struct expressions: @@ -101,8 +101,7 @@ Point3d { x, y: y_value, z }; ## Tuple struct expression A struct expression with fields enclosed in parentheses constructs a tuple struct. -Though it is listed here as a specific expression for completeness, it is equivalent to a [call expression] to the tuple struct's constructor. For example: +Though it is listed here as a specific expression for completeness, it is equivalent to a [call expression] to the tuple struct's constructor. For example: ```rust struct Position(i32, i32, i32); @@ -135,7 +134,7 @@ let b = Gamma{}; // Exact same value as `a`. [_PathInExpression_]: ../paths.md#paths-in-expressions [attributes on block expressions]: block-expr.md#attributes-on-block-expressions [call expression]: call-expr.md -[enum]: ../items/enumerations.md +[enum variant]: ../items/enumerations.md [if let]: if-expr.md#if-let-expressions [if]: if-expr.md#if-expressions [loop]: loop-expr.md