Skip to content

Commit 5d1df00

Browse files
2 parents ec72961 + 4e11b66 commit 5d1df00

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
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/macros/dry.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::ops::{Add, Mul, Sub};
1010
macro_rules! assert_equal_len {
1111
// The `tt` (token tree) designator is used for
1212
// operators and tokens.
13-
($a:ident, $b: ident, $func:ident, $op:tt) => (
13+
($a:ident, $b:ident, $func:ident, $op:tt) => (
1414
assert!($a.len() == $b.len(),
1515
"{:?}: dimension mismatch: {:?} {:?} {:?}",
1616
stringify!($func),
@@ -41,7 +41,7 @@ op!(sub_assign, Sub, -=, sub);
4141
mod test {
4242
use std::iter;
4343
macro_rules! test {
44-
($func: ident, $x:expr, $y:expr, $z:expr) => {
44+
($func:ident, $x:expr, $y:expr, $z:expr) => {
4545
#[test]
4646
fn $func() {
4747
for size in 0usize..10 {

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: 1 addition & 1 deletion
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
}

src/trait/derive.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ manually implemented if a more complex behavior is required.
66

77
The following is a list of derivable traits:
88
* Comparison traits:
9-
[`Eq`][eq], [`PartialEq`][partial-eq], [`Ord`][ord], [`PartialOrd`][partial-ord]
9+
[`Eq`][eq], [`PartialEq`][partial-eq], [`Ord`][ord], [`PartialOrd`][partial-ord].
1010
* [`Clone`][clone], to create `T` from `&T` via a copy.
11-
* [`Copy`][copy], to give a type 'copy semantics' instead of 'move semantics'
11+
* [`Copy`][copy], to give a type 'copy semantics' instead of 'move semantics'.
1212
* [`Hash`][hash], to compute a hash from `&T`.
1313
* [`Default`][default], to create an empty instance of a data type.
1414
* [`Debug`][debug], to format a value using the `{:?}` formatter.

0 commit comments

Comments
 (0)