@@ -495,8 +495,7 @@ reject the previous example if the arm with the wildcard pattern was
495
495
omitted.
496
496
497
497
A powerful application of pattern matching is * destructuring* :
498
- matching in order to bind names to the contents of data
499
- types.
498
+ matching in order to bind names to the contents of data types.
500
499
501
500
> *** Note:*** The following code makes use of tuples (` (f64, f64) ` ) which
502
501
> are explained in section 5.3. For now you can think of tuples as a list of
@@ -2726,7 +2725,8 @@ pub mod barn {
2726
2725
2727
2726
In short, ` mod foo; ` is just syntactic sugar for ` mod foo { /* content of <...>/foo.rs or <...>/foo/mod.rs */ } ` .
2728
2727
2729
- This also means that having two or more identical ` mod foo; ` declarations somewhere in your crate hierarchy is generally a bad idea,
2728
+ This also means that having two or more identical ` mod foo; ` declarations
2729
+ somewhere in your crate hierarchy is generally a bad idea,
2730
2730
just like copy-and-paste-ing a module into multiple places is a bad idea.
2731
2731
Both will result in duplicate and mutually incompatible definitions.
2732
2732
@@ -3074,11 +3074,6 @@ fn main() {
3074
3074
It's a bit weird, but it's the result of shadowing rules that have been set that way because
3075
3075
they model most closely what people expect to shadow.
3076
3076
3077
- ## Package ids
3078
-
3079
- If you use ` extern crate ` , per default ` rustc ` will look for libraries in the library search path (which you can
3080
- extend with the ` -L ` switch).
3081
-
3082
3077
## Crate metadata and settings
3083
3078
3084
3079
For every crate you can define a number of metadata items, such as link name, version or author.
@@ -3096,14 +3091,13 @@ Therefore, if you plan to compile your crate as a library, you should annotate i
3096
3091
// `lib.rs`
3097
3092
3098
3093
# #[crate_type = "lib"];
3099
- // Package ID
3100
3094
#[crate_id = "farm#2.5"];
3101
3095
3102
3096
// ...
3103
3097
# fn farm() {}
3104
3098
~~~~
3105
3099
3106
- You can also specify package ID information in a ` extern crate ` statement. For
3100
+ You can also specify crate id information in a ` extern crate ` statement. For
3107
3101
example, these ` extern crate ` statements would both accept and select the
3108
3102
crate define above:
3109
3103
@@ -3161,7 +3155,7 @@ Now compile and run like this (adjust to your platform if necessary):
3161
3155
Notice that the library produced contains the version in the file name
3162
3156
as well as an inscrutable string of alphanumerics. As explained in the previous paragraph,
3163
3157
these are both part of Rust's library versioning scheme. The alphanumerics are
3164
- a hash representing the crates package ID .
3158
+ a hash representing the crates id .
3165
3159
3166
3160
## The standard library and the prelude
3167
3161
@@ -3231,8 +3225,7 @@ library. You can link to a library such as `extra` with an `extern crate extra;
3231
3225
[ extra library ] : extra/index.html
3232
3226
3233
3227
Right now ` extra ` contains those definitions directly, but in the future it will likely just
3234
- re-export a bunch of 'officially blessed' crates that get managed with a
3235
- package manager.
3228
+ re-export a bunch of 'officially blessed' crates that get managed with a package manager.
3236
3229
3237
3230
# What next?
3238
3231
0 commit comments