rustbook support

This commit is contained in:
Alexis Beingessner 2015-06-24 12:15:45 -07:00
parent 3287372161
commit af2fd1d53e
12 changed files with 672 additions and 271 deletions

5
vec.md
View file

@ -11,7 +11,7 @@ project will only work on nightly (as of Rust 1.2.0).
First off, we need to come up with the struct layout. Naively we want this
design:
```
```rust
struct Vec<T> {
ptr: *mut T,
cap: usize,
@ -30,7 +30,7 @@ As we saw in the lifetimes chapter, we should use `Unique<T>` in place of `*mut
when we have a raw pointer to an allocation we own:
```
```rust
#![feature(unique)]
use std::ptr::{Unique, self};
@ -474,6 +474,7 @@ impl<T> DoubleEndedIterator for IntoIter<T> {
}
}
}
```
Because IntoIter takes ownership of its allocation, it needs to implement Drop
to free it. However it *also* wants to implement Drop to drop any elements it