From 3bcc68127d3b5bd95c6f1d2af1e544fdc0ae4de5 Mon Sep 17 00:00:00 2001 From: equal-l2 Date: Tue, 21 Jul 2020 08:39:30 +0900 Subject: Remove unrelevant comments --- src/listing.rs | 13 ------------- src/pipe.rs | 4 ---- 2 files changed, 17 deletions(-) (limited to 'src') 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: - // `::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>, 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()); } } -- cgit v1.2.3