mirror of https://github.com/rwf2/Rocket.git
Small fixes to code comments.
This commit is contained in:
parent
87a466211b
commit
3413129296
|
@ -27,9 +27,10 @@ impl Parser {
|
||||||
// Our `Parser` is self-referential. We cast a pointer to the heap
|
// Our `Parser` is self-referential. We cast a pointer to the heap
|
||||||
// allocation as `&'static` to allow the storage of the reference
|
// allocation as `&'static` to allow the storage of the reference
|
||||||
// along-side the allocation. This is safe as long as `buffer` is never
|
// along-side the allocation. This is safe as long as `buffer` is never
|
||||||
// dropped while `self` lives and an instance or reference to `cursor`
|
// dropped while `self` lives, `buffer` is never mutated, and an
|
||||||
// is never allowed to escape. Both of these properties can be
|
// instance or reference to `cursor` is never allowed to escape. These
|
||||||
// confirmed with a cursor look over the method signatures of `Parser`.
|
// properties can be confirmed with a cursory look over the method
|
||||||
|
// signatures and implementations of `Parser`.
|
||||||
let cursor = unsafe {
|
let cursor = unsafe {
|
||||||
let buffer: &'static TokenBuffer = ::std::mem::transmute(&*buffer);
|
let buffer: &'static TokenBuffer = ::std::mem::transmute(&*buffer);
|
||||||
buffer.begin()
|
buffer.begin()
|
||||||
|
|
|
@ -94,7 +94,7 @@ pub struct LocalRequest<'c> {
|
||||||
// lifetime of the `Request` object is tied to the lifetime of the
|
// lifetime of the `Request` object is tied to the lifetime of the
|
||||||
// `LocalResponse`, so references from `Request` cannot be dangling in
|
// `LocalResponse`, so references from `Request` cannot be dangling in
|
||||||
// `Response`. And finally, observe how all of the data stored in `Request`
|
// `Response`. And finally, observe how all of the data stored in `Request`
|
||||||
// is convered into its owned counterpart before insertion, ensuring stable
|
// is converted into its owned counterpart before insertion, ensuring stable
|
||||||
// addresses. Together, these properties guarantee the second condition.
|
// addresses. Together, these properties guarantee the second condition.
|
||||||
request: Rc<Request<'c>>,
|
request: Rc<Request<'c>>,
|
||||||
data: Vec<u8>
|
data: Vec<u8>
|
||||||
|
|
Loading…
Reference in New Issue