Remove unused generic parameter from Chunk

This commit is contained in:
Tangent 128 2018-04-09 17:53:32 -04:00
parent 065e653f86
commit adea1e4389
2 changed files with 7 additions and 7 deletions

View File

@ -20,17 +20,17 @@ const SRC_FILE: &'static [u8] = include_bytes!("../data/test1.webm");
#[derive(Clone)]
struct WebmServer;
type BodyStream<B> = Box<Stream<Item = Chunk<B>, Error = hyper::Error>>;
type BodyStream = Box<Stream<Item = Chunk, Error = hyper::Error>>;
impl Service for WebmServer {
type Request = Request;
type Response = Response<BodyStream<Vec<u8>>>;
type Response = Response<BodyStream>;
type Error = hyper::Error;
type Future = FutureResult<Self::Response, hyper::Error>;
fn call(&self, req: Request) -> Self::Future {
let response = match (req.method(), req.path()) {
(&Get, "/loop") => {
let stream: BodyStream<Vec<u8>> = Box::new(
let stream: BodyStream = Box::new(
repeat::<&[u8], ()>(SRC_FILE).take(5)
.parse_ebml().chunk_webm().fix_timecodes().find_starting_point()
.map_err(|err| match err {

View File

@ -52,17 +52,17 @@ impl AsRef<[u8]> for ClusterHead {
}
#[derive(Clone, Debug)]
pub enum Chunk<B: AsRef<[u8]> = Vec<u8>> {
pub enum Chunk {
Headers {
bytes: Arc<B>
bytes: Arc<Vec<u8>>
},
ClusterHead(ClusterHead),
ClusterBody {
bytes: Arc<B>
bytes: Arc<Vec<u8>>
}
}
impl<B: AsRef<[u8]>> AsRef<[u8]> for Chunk<B> {
impl AsRef<[u8]> for Chunk {
fn as_ref(&self) -> &[u8] {
match self {
&Chunk::Headers {ref bytes, ..} => bytes.as_ref().as_ref(),