This commit is contained in:
Dhghomon 2021-03-23 04:27:01 +00:00
parent ec785d3fbc
commit f4cd4a150b
2 changed files with 2 additions and 2 deletions

View File

@ -308,7 +308,7 @@ fn main() {
} }
</code></pre></pre> </code></pre></pre>
<p>So it's almost like saying <code>let my_number = { 100 };</code>.</p> <p>So it's almost like saying <code>let my_number = { 100 };</code>.</p>
<p>Also note that <code>my_number</code> is not <code>mut</code>. We didn't give it a value until we gave it 50, so it never changed its value. In the end, the real code for <code>my_number</code> is just let <code>my_number = 100;</code>.</p> <p>Also note that <code>my_number</code> is not <code>mut</code>. We didn't give it a value until we gave it 50, so it never changed its value. In the end, the real code for <code>my_number</code> is just <code>let my_number = 100;</code>.</p>
</main> </main>

View File

@ -1532,7 +1532,7 @@ fn main() {
} }
</code></pre></pre> </code></pre></pre>
<p>So it's almost like saying <code>let my_number = { 100 };</code>.</p> <p>So it's almost like saying <code>let my_number = { 100 };</code>.</p>
<p>Also note that <code>my_number</code> is not <code>mut</code>. We didn't give it a value until we gave it 50, so it never changed its value. In the end, the real code for <code>my_number</code> is just let <code>my_number = 100;</code>.</p> <p>Also note that <code>my_number</code> is not <code>mut</code>. We didn't give it a value until we gave it 50, so it never changed its value. In the end, the real code for <code>my_number</code> is just <code>let my_number = 100;</code>.</p>
<h2 id="collection-types"><a class="header" href="#collection-types">Collection types</a></h2> <h2 id="collection-types"><a class="header" href="#collection-types">Collection types</a></h2>
<p>Rust has a lot of types for making a collection. Collections are for when you need more than one value in one spot. For example, you could have information on all the cities in your country inside one variable. We will start with arrays, which are fastest but also have the least functionality. They are kind of like <code>&amp;str</code> in that way.</p> <p>Rust has a lot of types for making a collection. Collections are for when you need more than one value in one spot. For example, you could have information on all the cities in your country inside one variable. We will start with arrays, which are fastest but also have the least functionality. They are kind of like <code>&amp;str</code> in that way.</p>
<h3 id="arrays"><a class="header" href="#arrays">Arrays</a></h3> <h3 id="arrays"><a class="header" href="#arrays">Arrays</a></h3>