mirror of
https://github.com/rust-lang/book.git
synced 2026-11-30 23:41:22 -06:00
rebuild pages at d95ab62
This commit is contained in:
+3
-3
@@ -150,9 +150,9 @@ be similar to using an argument to a function in the body without declaring it
|
||||
in the signature. We need to tell Rust that we've introduced a generic
|
||||
parameter. The syntax to do that is the angle brackets, like this:</p>
|
||||
<pre><code class="language-text">enum OptionalNumber<T> { enum OptionalFloatingPointNumber<T> {
|
||||
Some(T), Some(T),
|
||||
None, None,
|
||||
} }
|
||||
Some(T), Some(T),
|
||||
None, None,
|
||||
} }
|
||||
</code></pre>
|
||||
<p>The <code><></code>s after the enum name indicate a list of type parameters, just like
|
||||
<code>()</code> after a function name indicates a list of value parameters. Now the only
|
||||
|
||||
+3
-3
@@ -7072,9 +7072,9 @@ be similar to using an argument to a function in the body without declaring it
|
||||
in the signature. We need to tell Rust that we've introduced a generic
|
||||
parameter. The syntax to do that is the angle brackets, like this:</p>
|
||||
<pre><code class="language-text">enum OptionalNumber<T> { enum OptionalFloatingPointNumber<T> {
|
||||
Some(T), Some(T),
|
||||
None, None,
|
||||
} }
|
||||
Some(T), Some(T),
|
||||
None, None,
|
||||
} }
|
||||
</code></pre>
|
||||
<p>The <code><></code>s after the enum name indicate a list of type parameters, just like
|
||||
<code>()</code> after a function name indicates a list of value parameters. Now the only
|
||||
|
||||
Reference in New Issue
Block a user