Skip to content

Commit 4e11b66

Browse files
authored
Merge pull request #1136 from codesections/enum_use_2018_edition
Update syntax for 2018 Edition
2 parents 0559f0a + da6b750 commit 4e11b66

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

src/custom_types/enum/enum_use.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ enum Work {
1919
fn main() {
2020
// Explicitly `use` each name so they are available without
2121
// manual scoping.
22-
use Status::{Poor, Rich};
22+
use crate::Status::{Poor, Rich};
2323
// Automatically `use` each name inside `Work`.
24-
use Work::*;
24+
use crate::Work::*;
2525
2626
// Equivalent to `Status::Poor`.
2727
let status = Poor;

src/custom_types/enum/testcase_linked_list.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
A common use for `enums` is to create a linked-list:
44

55
```rust,editable
6-
use List::*;
6+
use crate::List::*;
77
88
enum List {
99
// Cons: Tuple struct that wraps an element and a pointer to the next node

src/mod/super.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ mod my {
4444
// This will bind to the `cool::function` in the *crate* scope.
4545
// In this case the crate scope is the outermost scope.
4646
{
47-
use cool::function as root_function;
47+
use crate::cool::function as root_function;
4848
root_function();
4949
}
5050
}
@@ -53,4 +53,4 @@ mod my {
5353
fn main() {
5454
my::indirect_call();
5555
}
56-
```
56+
```

src/mod/use.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ access. It is often used like this:
66
```rust,editable,ignore
77
// extern crate deeply; // normally, this would exist and not be commented out!
88
9-
use deeply::nested::{
9+
use crate::deeply::nested::{
1010
my_first_function,
1111
my_second_function,
1212
AndATraitType
@@ -43,7 +43,7 @@ fn main() {
4343
{
4444
// This is equivalent to `use deeply::nested::function as function`.
4545
// This `function()` will shadow the outer one.
46-
use deeply::nested::function;
46+
use crate::deeply::nested::function;
4747
function();
4848
4949
// `use` bindings have a local scope. In this case, the

src/mod/visibility.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ mod my_mod {
3737
3838
// Functions declared using `pub(in path)` syntax are only visible
3939
// within the given path. `path` must be a parent or ancestor module
40-
pub(in my_mod) fn public_function_in_my_mod() {
40+
pub(in crate::my_mod) fn public_function_in_my_mod() {
4141
print!("called `my_mod::nested::public_function_in_my_mod()`, that\n > ");
4242
public_function_in_nested()
4343
}
@@ -114,4 +114,4 @@ fn main() {
114114
//my_mod::private_nested::function();
115115
// TODO ^ Try uncommenting this line
116116
}
117-
```
117+
```

0 commit comments

Comments
 (0)