mirror of
https://github.com/Dhghomon/easy_rust
synced 2024-11-17 15:29:51 +00:00
deploy: 1980638e43
This commit is contained in:
parent
6129c322cc
commit
8374050d1d
@ -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,
|
||||
|
@ -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
Loading…
Reference in New Issue
Block a user