diff options
Diffstat (limited to 'src/docs/needless_borrow.txt')
| -rw-r--r-- | src/docs/needless_borrow.txt | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/src/docs/needless_borrow.txt b/src/docs/needless_borrow.txt deleted file mode 100644 index 4debcf47372..00000000000 --- a/src/docs/needless_borrow.txt +++ /dev/null @@ -1,21 +0,0 @@ -### What it does -Checks for address of operations (`&`) that are going to -be dereferenced immediately by the compiler. - -### Why is this bad? -Suggests that the receiver of the expression borrows -the expression. - -### Example -``` -fn fun(_a: &i32) {} - -let x: &i32 = &&&&&&5; -fun(&x); -``` - -Use instead: -``` -let x: &i32 = &5; -fun(x); -``` \ No newline at end of file |
