From c1e52c71cae901c25b2cea7b47c834501e09ecb6 Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Wed, 2 Apr 2014 16:54:33 -0700 Subject: `extern crate` and `mod` are not easily confused Remove some statements that used to refer to similarities between `mod` and `extern mod`, before the latter was renamed to `extern crate`. --- src/doc/tutorial.md | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/doc/tutorial.md') diff --git a/src/doc/tutorial.md b/src/doc/tutorial.md index 62e0fabdc05..65b3def8daf 100644 --- a/src/doc/tutorial.md +++ b/src/doc/tutorial.md @@ -2600,8 +2600,6 @@ As you can see, your module hierarchy is now three modules deep: There is the cr function, and the module `farm`. The module `farm` also contains two functions and a third module `barn`, which contains a function `hay`. -(In case you already stumbled over `extern crate`: It isn't directly related to a bare `mod`, we'll get to it later. ) - ## Paths and visibility We've now defined a nice module hierarchy. But how do we access the items in it from our `main` function? @@ -3050,7 +3048,6 @@ fn main() { } ~~~ -Despite its name, `extern crate` is a distinct construct from regular `mod` declarations: A statement of the form `extern crate foo;` will cause `rustc` to search for the crate `foo`, and if it finds a matching binary it lets you use it from inside your crate. -- cgit 1.4.1-3-g733a5 From 544516ac63605a689c904504439e484bd5897522 Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Wed, 2 Apr 2014 16:56:23 -0700 Subject: Fix reference to "these two traits." There are actually three traits listed. --- src/doc/tutorial.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/doc/tutorial.md') diff --git a/src/doc/tutorial.md b/src/doc/tutorial.md index 65b3def8daf..352595e8a7a 100644 --- a/src/doc/tutorial.md +++ b/src/doc/tutorial.md @@ -2107,7 +2107,7 @@ references, or types where the only contained references have the `'static` lifetime. (For more on named lifetimes and their uses, see the [references and lifetimes guide][lifetimes].) -> ***Note:*** These two traits were referred to as 'kinds' in earlier +> ***Note:*** These built-in traits were referred to as 'kinds' in earlier > iterations of the language, and often still are. Additionally, the `Drop` trait is used to define destructors. This -- cgit 1.4.1-3-g733a5 From 1ac8b34ccd02965886d3ca0bd83115c7f7b73729 Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Wed, 2 Apr 2014 17:02:18 -0700 Subject: Minor spelling/grammar/usage fixes. Note: "different to" is not exactly incorrect, but "different from" is more commonly accepted in both US and Commonwealth English, and also more consistent with other usage within this tutorial. --- src/doc/tutorial.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/doc/tutorial.md') diff --git a/src/doc/tutorial.md b/src/doc/tutorial.md index 352595e8a7a..9e0f3ce19f6 100644 --- a/src/doc/tutorial.md +++ b/src/doc/tutorial.md @@ -2841,11 +2841,11 @@ use farm::cow; The path you give to `use` is per default global, meaning relative to the crate root, no matter how deep the module hierarchy is, or whether the module body it's written in -is contained in its own file (remember: files are irrelevant). +is contained in its own file. (Remember: files are irrelevant.) -This is different to other languages, where you often only find a single import construct that combines the semantic +This is different from other languages, where you often only find a single import construct that combines the semantic of `mod foo;` and `use`-statements, and which tend to work relative to the source file or use an absolute file path -- Rubys `require` or C/C++'s `#include` come to mind. +- Ruby's `require` or C/C++'s `#include` come to mind. However, it's also possible to import things relative to the module of the `use`-statement: Adding a `super::` in front of the path will start in the parent module, @@ -3025,7 +3025,7 @@ The nested `barn` module is private, but the `pub use` allows users of the module `farm` to access a function from `barn` without needing to know that `barn` exists. -In other words, you can use them to decouple an public api from their internal implementation. +In other words, you can use it to decouple a public api from its internal implementation. ## Using libraries -- cgit 1.4.1-3-g733a5