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
|
||||
// allocation as `&'static` to allow the storage of the reference
|
||||
// along-side the allocation. This is safe as long as `buffer` is never
|
||||
// dropped while `self` lives and an instance or reference to `cursor`
|
||||
// is never allowed to escape. Both of these properties can be
|
||||
// confirmed with a cursor look over the method signatures of `Parser`.
|
||||
// dropped while `self` lives, `buffer` is never mutated, and an
|
||||
// instance or reference to `cursor` is never allowed to escape. These
|
||||
// properties can be confirmed with a cursory look over the method
|
||||
// signatures and implementations of `Parser`.
|
||||
let cursor = unsafe {
|
||||
let buffer: &'static TokenBuffer = ::std::mem::transmute(&*buffer);
|
||||
buffer.begin()
|
||||
|
|
|
@ -91,10 +91,10 @@ pub struct LocalRequest<'c> {
|
|||
// `Send` nor `Sync`. The second is more difficult to argue. First, observe
|
||||
// that any methods of `LocalRequest` that _remove_ values from `Request`
|
||||
// only remove _Copy_ values, in particular, `SocketAddr`. Second, the
|
||||
// lifetime of the `Request` object is tied tot he lifetime of the
|
||||
// lifetime of the `Request` object is tied to the lifetime of the
|
||||
// `LocalResponse`, so references from `Request` cannot be dangling in
|
||||
// `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.
|
||||
request: Rc<Request<'c>>,
|
||||
data: Vec<u8>
|
||||
|
|
Loading…
Reference in New Issue