File tree 3 files changed +5
-5
lines changed
3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ $ ls target/debug
115
115
build deps examples libphrases-a7448e02a0468eaa.rlib native
116
116
```
117
117
118
- ` libphrases-hash.rlib ` is the compiled crate. Before we see how to use this
118
+ ` libphrases-< hash> .rlib ` is the compiled crate. Before we see how to use this
119
119
crate from another crate, let’s break it up into multiple files.
120
120
121
121
# Multiple File Crates
Original file line number Diff line number Diff line change @@ -225,7 +225,7 @@ sense to put it into a function:
225
225
``` rust
226
226
# fn find (_ : & str , _ : char ) -> Option <usize > { None }
227
227
// Returns the extension of the given file name, where the extension is defined
228
- // as all characters proceeding the first `.`.
228
+ // as all characters following the first `.`.
229
229
// If `file_name` has no `.`, then `None` is returned.
230
230
fn extension_explicit (file_name : & str ) -> Option <& str > {
231
231
match find (file_name , '.' ) {
@@ -274,7 +274,7 @@ to get rid of the case analysis:
274
274
``` rust
275
275
# fn find (_ : & str , _ : char ) -> Option <usize > { None }
276
276
// Returns the extension of the given file name, where the extension is defined
277
- // as all characters proceeding the first `.`.
277
+ // as all characters following the first `.`.
278
278
// If `file_name` has no `.`, then `None` is returned.
279
279
fn extension (file_name : & str ) -> Option <& str > {
280
280
find (file_name , '.' ). map (| i | & file_name [i + 1 .. ])
Original file line number Diff line number Diff line change @@ -84,8 +84,8 @@ fn it_works() {
84
84
```
85
85
86
86
` assert! ` is a macro provided by Rust which takes one argument: if the argument
87
- is ` true ` , nothing happens. If the argument is ` false ` , it ` panic! ` s . Let's run
88
- our tests again:
87
+ is ` true ` , nothing happens. If the argument is ` false ` , it will ` panic! ` . Let's
88
+ run our tests again:
89
89
90
90
``` bash
91
91
$ cargo test
You can’t perform that action at this time.
0 commit comments