This commit is contained in:
Dhghomon 2021-02-14 08:27:57 +00:00
parent 6129c322cc
commit 8374050d1d
4 changed files with 4 additions and 4 deletions

View File

@ -307,7 +307,7 @@ fn main() {
2
3
</code></pre>
<p>You can give it a different number though if you want - Rust doesn't care and can use it in the same way. Just add an <code>=</code> and your number to the variant that you want to have a number. You don't have to give all of them a number. But if you don't, Rust will just add 1 from the arm before to give it a number.</p>
<p>Though you can give it a different number, if you want - Rust doesn't care and can use it in the same way. Just add an <code>=</code> and your number to the variant that you want to have a number. You don't have to give all of them a number. But if you don't, Rust will just add 1 from the arm before to give it a number.</p>
<pre><pre class="playground"><code class="language-rust">enum Star {
BrownDwarf = 10,
RedDwarf = 50,

View File

@ -2204,7 +2204,7 @@ fn main() {
2
3
</code></pre>
<p>You can give it a different number though if you want - Rust doesn't care and can use it in the same way. Just add an <code>=</code> and your number to the variant that you want to have a number. You don't have to give all of them a number. But if you don't, Rust will just add 1 from the arm before to give it a number.</p>
<p>Though you can give it a different number, if you want - Rust doesn't care and can use it in the same way. Just add an <code>=</code> and your number to the variant that you want to have a number. You don't have to give all of them a number. But if you don't, Rust will just add 1 from the arm before to give it a number.</p>
<pre><pre class="playground"><code class="language-rust">enum Star {
BrownDwarf = 10,
RedDwarf = 50,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long