Skip to content

Commit 6cb03ba

Browse files
committed
Fix formatting of the pointers guide.
1 parent 0e06f71 commit 6cb03ba

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/doc/guide-pointers.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ fn add_one(x: &mut int) -> int {
572572
fn main() {
573573
let x = box 5i;
574574
575-
println!("{}", add_one(&*x)); // error: cannot borrow immutable dereference
575+
println!("{}", add_one(&*x)); // error: cannot borrow immutable dereference
576576
// of `&`-pointer as mutable
577577
}
578578
```
@@ -700,9 +700,9 @@ This gives you flexibility without sacrificing performance.
700700

701701
You may think that this gives us terrible performance: return a value and then
702702
immediately box it up ?! Isn't that the worst of both worlds? Rust is smarter
703-
than that. There is no copy in this code. main allocates enough room for the
704-
`box , passes a pointer to that memory into foo as x, and then foo writes the
705-
value straight into that pointer. This writes the return value directly into
703+
than that. There is no copy in this code. `main` allocates enough room for the
704+
`box`, passes a pointer to that memory into `foo` as `x`, and then `foo` writes
705+
the value straight into that pointer. This writes the return value directly into
706706
the allocated box.
707707

708708
This is important enough that it bears repeating: pointers are not for

0 commit comments

Comments
 (0)