Simplify/sanify some types

This commit is contained in:
Tangent 2020-05-08 21:15:18 -04:00
parent 00ec517e78
commit c422a1c3f3
6 changed files with 40 additions and 66 deletions

View file

@ -13,7 +13,6 @@ use tokio::time::{
};
use crate::chunk::Chunk;
use crate::error::WebmetroError;
pub struct ChunkTimecodeFixer {
current_offset: u64,
@ -29,7 +28,7 @@ impl ChunkTimecodeFixer {
assumed_duration: 33
}
}
pub fn process<'a>(&mut self, mut chunk: Chunk) -> Chunk {
pub fn process(&mut self, mut chunk: Chunk) -> Chunk {
match chunk {
Chunk::ClusterHead(ref mut cluster_head) => {
let start = cluster_head.start;
@ -111,11 +110,11 @@ impl<S> Throttle<S> {
}
}
impl<S: TryStream<Ok = Chunk, Error = WebmetroError> + Unpin> Stream for Throttle<S>
impl<S: TryStream<Ok = Chunk> + Unpin> Stream for Throttle<S>
{
type Item = Result<Chunk, WebmetroError>;
type Item = Result<Chunk, S::Error>;
fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll<Option<Result<Chunk, WebmetroError>>> {
fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll<Option<Result<Chunk, S::Error>>> {
match self.sleep.poll_unpin(cx) {
Poll::Pending => return Poll::Pending,
Poll::Ready(()) => { /* can continue */ },