mirror of
https://github.com/Dhghomon/easy_rust
synced 2024-11-11 07:11:02 +00:00
deploy: 5ff8fe1088
This commit is contained in:
parent
613ed5c0ac
commit
f6ac75a189
@ -188,7 +188,7 @@ note: the function `prints_one_thing` is defined here
|
|||||||
4 | fn prints_one_thing<T: Display>(input: T) {
|
4 | fn prints_one_thing<T: Display>(input: T) {
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<p>It's easy to understand that function <code>print_one_thing</code> is private. It also shows us with <code>src\main.rs:4:5</code> where to find the function. This is helpful because you can write <code>mod</code>s not just in one file, but over a lot of files as well.</p>
|
<p>It's easy to understand that function <code>prints_one_thing</code> is private. It also shows us with <code>src\main.rs:4:5</code> where to find the function. This is helpful because you can write <code>mod</code>s not just in one file, but over a lot of files as well.</p>
|
||||||
<p>Now we just write <code>pub fn</code> instead of <code>fn</code> and everything works.</p>
|
<p>Now we just write <code>pub fn</code> instead of <code>fn</code> and everything works.</p>
|
||||||
<pre><pre class="playground"><code class="language-rust">mod print_things {
|
<pre><pre class="playground"><code class="language-rust">mod print_things {
|
||||||
use std::fmt::Display;
|
use std::fmt::Display;
|
||||||
|
@ -8707,7 +8707,7 @@ note: the function `prints_one_thing` is defined here
|
|||||||
4 | fn prints_one_thing<T: Display>(input: T) {
|
4 | fn prints_one_thing<T: Display>(input: T) {
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<p>It's easy to understand that function <code>print_one_thing</code> is private. It also shows us with <code>src\main.rs:4:5</code> where to find the function. This is helpful because you can write <code>mod</code>s not just in one file, but over a lot of files as well.</p>
|
<p>It's easy to understand that function <code>prints_one_thing</code> is private. It also shows us with <code>src\main.rs:4:5</code> where to find the function. This is helpful because you can write <code>mod</code>s not just in one file, but over a lot of files as well.</p>
|
||||||
<p>Now we just write <code>pub fn</code> instead of <code>fn</code> and everything works.</p>
|
<p>Now we just write <code>pub fn</code> instead of <code>fn</code> and everything works.</p>
|
||||||
<pre><pre class="playground"><code class="language-rust">mod print_things {
|
<pre><pre class="playground"><code class="language-rust">mod print_things {
|
||||||
use std::fmt::Display;
|
use std::fmt::Display;
|
||||||
|
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