diff options
author | equal-l2 <eng.equall2@gmail.com> | 2020-07-20 23:39:30 +0000 |
---|---|---|
committer | equal-l2 <eng.equall2@gmail.com> | 2020-07-21 16:53:06 +0000 |
commit | 3bcc68127d3b5bd95c6f1d2af1e544fdc0ae4de5 (patch) | |
tree | 7b73615055631658a94a57c20b09431f5c1de8bc | |
parent | Use actix-web-httpauth for authentication middleware (diff) | |
download | miniserve-3bcc68127d3b5bd95c6f1d2af1e544fdc0ae4de5.tar.gz miniserve-3bcc68127d3b5bd95c6f1d2af1e544fdc0ae4de5.zip |
Remove unrelevant comments
-rw-r--r-- | src/listing.rs | 13 | ||||
-rw-r--r-- | src/pipe.rs | 4 |
2 files changed, 0 insertions, 17 deletions
diff --git a/src/listing.rs b/src/listing.rs index a4eda88..388153f 100644 --- a/src/listing.rs +++ b/src/listing.rs @@ -321,19 +321,6 @@ pub fn directory_listing( } }); - // `rx` is a receiver of bytes - it can act like a `Stream` of bytes, and that's exactly - // what actix-web wants to stream the response. - // - // But right now the error types do not match: - // `<rx as Stream>::Error == ()`, but we want `actix_web::error::Error` - // - // That being said, `rx` will never fail because the `Stream` implementation for `Receiver` - // never returns an error - it simply cannot fail. - //let rx = rx.map_err(|_| unreachable!("pipes never fail")); - - // At this point, `rx` implements everything actix want for a streamed response, - // so we can just give a `Box::new(rx)` as streaming body. - Ok(ServiceResponse::new( req.clone(), HttpResponse::Ok() diff --git a/src/pipe.rs b/src/pipe.rs index 92f7019..374a45f 100644 --- a/src/pipe.rs +++ b/src/pipe.rs @@ -9,8 +9,6 @@ use std::io::{Error, ErrorKind, Result, Write}; /// /// It uses an intermediate buffer to transfer packets. pub struct Pipe { - // Wrapping the sender in `Wait` makes it blocking, so we can implement blocking-style - // io::Write over the async-style Sender. dest: Sender<std::result::Result<Bytes, ()>>, bytes: BytesMut, } @@ -27,8 +25,6 @@ impl Pipe { impl Drop for Pipe { fn drop(&mut self) { - // This is the correct thing to do, but is not super important since the `Sink` - // implementation of `Sender` just returns `Ok` without doing anything else. let _ = block_on(self.dest.close()); } } |