@@ -804,7 +804,7 @@ confusing numbers that correspond to different units.
804
804
We've already seen several function definitions. Like all other static
805
805
declarations, such as ` type ` , functions can be declared both at the
806
806
top level and inside other functions (or in modules, which we'll come
807
- back to [ later] ( #modules -and-crates ) ). The ` fn ` keyword introduces a
807
+ back to [ later] ( #crates -and-the-module-system ) ). The ` fn ` keyword introduces a
808
808
function. A function has an argument list, which is a parenthesized
809
809
list of ` expr: type ` pairs separated by commas. An arrow ` -> `
810
810
separates the argument list and the function's return type.
@@ -2711,10 +2711,10 @@ extend with the `-L` switch).
2711
2711
However, Rust also ships with rustpkg, a package manager that is able to automatically download and build
2712
2712
libraries if you use it for building your crate. How it works is explained [ here] [ rustpkg ] ,
2713
2713
but for this tutorial it's only important to know that you can optionally annotate an
2714
- ` extern mod ` statement with an package id that rustpkg can use to identify it:
2714
+ ` extern mod ` statement with a package id that rustpkg can use to identify it:
2715
2715
2716
2716
~~~ {.ignore}
2717
- extern mod rust = "github.com/mozilla/rust"; // pretend Rust is an simple library
2717
+ extern mod rust = "github.com/mozilla/rust"; // pretend Rust is a simple library
2718
2718
~~~
2719
2719
2720
2720
[ rustpkg ] : rustpkg.html
@@ -2730,7 +2730,7 @@ the link name and the version. It also hashes the filename and the symbols in a
2730
2730
based on the link metadata, allowing you to use two different versions of the same library in a crate
2731
2731
without conflict.
2732
2732
2733
- Therefor , if you plan to compile your crate as a library, you should annotate it with that information:
2733
+ Therefore , if you plan to compile your crate as a library, you should annotate it with that information:
2734
2734
2735
2735
~~~~
2736
2736
// lib.rs
@@ -2746,8 +2746,8 @@ Therefor, if you plan to compile your crate as a library, you should annotate it
2746
2746
You can also in turn require in a ` extern mod ` statement that certain link metadata items match some criteria.
2747
2747
For that, Rust currently parses a comma-separated list of name/value pairs that appear after
2748
2748
it, and ensures that they match the attributes provided in the ` link ` attribute of a crate file.
2749
- This enables you to, eg , pick a a crate based on it's version number, or to link an library under an
2750
- different name. For example, this two mod statements would both accept and select the crate define above:
2749
+ This enables you to, e.g. , pick a crate based on its version number, or link a library under a
2750
+ different name. For example, these two ` mod ` statements would both accept and select the crate define above:
2751
2751
2752
2752
~~~~ {.xfail-test}
2753
2753
extern mod farm(vers = "2.5");
@@ -2836,14 +2836,14 @@ This allows you to use common types and functions like `Option<T>` or `println`
2836
2836
without needing to import them. And if you need something from ` std ` that's not in the prelude,
2837
2837
you just have to import it with an ` use ` statement.
2838
2838
2839
- For example, it re-exports ` println ` which is defined in ` std::io::println ` :
2839
+ For example, it re-exports ` println ` which is defined in ` std::io::stdio:: println ` :
2840
2840
2841
2841
~~~
2842
2842
use puts = std::io::stdio::println;
2843
2843
2844
2844
fn main() {
2845
2845
println("println is imported per default.");
2846
- puts("Doesn't hinder you from importing it under an different name yourself.");
2846
+ puts("Doesn't hinder you from importing it under a different name yourself.");
2847
2847
::std::io::stdio::println("Or from not using the automatic import.");
2848
2848
}
2849
2849
~~~
0 commit comments