From 44edd6a4d468f9161d5249802f2dff4ead88fc3b Mon Sep 17 00:00:00 2001 From: Oliver Gould Date: Thu, 20 Jul 2017 18:29:36 +0000 Subject: [PATCH] clear some warnings --- src/frame/mod.rs | 2 +- src/proto/connection.rs | 4 ++-- src/proto/flow_control_state.rs | 14 +++++++------- src/proto/mod.rs | 10 +++++----- src/proto/ping_pong.rs | 4 ++-- src/proto/state.rs | 8 +------- src/proto/stream_recv_close.rs | 6 ------ src/proto/stream_recv_open.rs | 2 -- src/proto/stream_send_close.rs | 5 ----- src/proto/stream_send_open.rs | 2 -- 10 files changed, 18 insertions(+), 39 deletions(-) diff --git a/src/frame/mod.rs b/src/frame/mod.rs index 5047867..af65434 100644 --- a/src/frame/mod.rs +++ b/src/frame/mod.rs @@ -87,7 +87,7 @@ impl Frame { match self { &Headers(ref v) => v.is_end_stream(), &Data(ref v) => v.is_end_stream(), - &Reset(ref v) => true, + &Reset(_) => true, &PushPromise(_) | &WindowUpdate(_) | diff --git a/src/proto/connection.rs b/src/proto/connection.rs index 7098943..93d04d1 100644 --- a/src/proto/connection.rs +++ b/src/proto/connection.rs @@ -1,9 +1,9 @@ use {ConnectionError, Frame}; use client::Client; use error; -use frame::{self, SettingSet, StreamId}; +use frame::{self, StreamId}; use proto::*; -use proto::ping_pong::PingPayload; +//use proto::ping_pong::PingPayload; use server::Server; use bytes::{Bytes, IntoBuf}; diff --git a/src/proto/flow_control_state.rs b/src/proto/flow_control_state.rs index 4babb39..2c5c426 100644 --- a/src/proto/flow_control_state.rs +++ b/src/proto/flow_control_state.rs @@ -31,13 +31,13 @@ impl FlowControlState { } } - pub fn with_next_update(next_window_update: WindowSize) -> FlowControlState { - FlowControlState { - window_size: 0, - underflow: 0, - next_window_update, - } - } + // pub fn with_next_update(next_window_update: WindowSize) -> FlowControlState { + // FlowControlState { + // window_size: 0, + // underflow: 0, + // next_window_update, + // } + // } /// Reduce future capacity of the window. /// diff --git a/src/proto/mod.rs b/src/proto/mod.rs index 4563091..17b390a 100644 --- a/src/proto/mod.rs +++ b/src/proto/mod.rs @@ -1,6 +1,6 @@ -use {frame, ConnectionError, Peer, StreamId}; +use {frame, Peer, StreamId}; use error::Reason; -use frame::{Frame, SettingSet}; +use frame::Frame; use bytes::{Buf, IntoBuf}; use futures::*; @@ -25,13 +25,13 @@ mod stream_store; pub use self::connection::Connection; use self::flow_control::{ControlFlow, FlowControl}; -use self::flow_control_state::{FlowControlState, WindowUnderflow}; +use self::flow_control_state::{FlowControlState}; use self::framed_read::FramedRead; use self::framed_write::FramedWrite; use self::ping_pong::{ControlPing, PingPayload, PingPong}; use self::ready::ReadySink; -use self::settings::{ApplySettings, ControlSettings, Settings}; -use self::state::{StreamState, PeerState}; +use self::settings::{ApplySettings, /*ControlSettings,*/ Settings}; +use self::state::{StreamState}; use self::stream_recv_close::StreamRecvClose; use self::stream_recv_open::StreamRecvOpen; use self::stream_send_close::StreamSendClose; diff --git a/src/proto/ping_pong.rs b/src/proto/ping_pong.rs index 1a21b36..ece90ff 100644 --- a/src/proto/ping_pong.rs +++ b/src/proto/ping_pong.rs @@ -1,6 +1,6 @@ -use {ConnectionError, StreamId}; +use ConnectionError; use frame::{Frame, Ping, SettingSet}; -use proto::{ApplySettings, ReadySink, ControlStreams, FlowControlState}; +use proto::{ApplySettings, ReadySink}; use futures::*; diff --git a/src/proto/state.rs b/src/proto/state.rs index a28d675..fa79940 100644 --- a/src/proto/state.rs +++ b/src/proto/state.rs @@ -1,14 +1,8 @@ -use {Peer, StreamId}; -use error::{ConnectionError, Reason}; +use {ConnectionError, Peer}; use error::Reason::*; use error::User::*; use proto::{FlowControlState, WindowSize}; -use fnv::FnvHasher; -use ordermap::{Entry, OrderMap}; -use std::hash::BuildHasherDefault; -use std::marker::PhantomData; - /// Represents the state of an H2 stream /// /// ```not_rust diff --git a/src/proto/stream_recv_close.rs b/src/proto/stream_recv_close.rs index 1988ca9..b84bfe8 100644 --- a/src/proto/stream_recv_close.rs +++ b/src/proto/stream_recv_close.rs @@ -1,15 +1,9 @@ use {ConnectionError}; use error::Reason; -use error::User; use frame::{self, Frame}; use proto::*; use proto::ready::ReadySink; -use fnv::FnvHasher; -use futures::*; -use ordermap::OrderMap; -use std::hash::BuildHasherDefault; - // TODO track "last stream id" for GOAWAY. // TODO track/provide "next" stream id. // TODO reset_streams needs to be bounded. diff --git a/src/proto/stream_recv_open.rs b/src/proto/stream_recv_open.rs index 56c94b2..5db91ea 100644 --- a/src/proto/stream_recv_open.rs +++ b/src/proto/stream_recv_open.rs @@ -2,8 +2,6 @@ use ConnectionError; use frame::{Frame, StreamId}; use proto::*; -use futures::*; - /// Tracks a connection's streams. #[derive(Debug)] pub struct StreamRecvOpen { diff --git a/src/proto/stream_send_close.rs b/src/proto/stream_send_close.rs index b78fd64..1decb24 100644 --- a/src/proto/stream_send_close.rs +++ b/src/proto/stream_send_close.rs @@ -1,13 +1,8 @@ use ConnectionError; -use client::Client; use error::Reason; -use error::User; use frame::{self, Frame}; use proto::*; -use futures::*; -use std::marker::PhantomData; - // TODO track "last stream id" for GOAWAY. // TODO track/provide "next" stream id. // TODO reset_streams needs to be bounded. diff --git a/src/proto/stream_send_open.rs b/src/proto/stream_send_open.rs index 3e6d367..5f1dcba 100644 --- a/src/proto/stream_send_open.rs +++ b/src/proto/stream_send_open.rs @@ -3,8 +3,6 @@ use error::User::{InvalidStreamId, StreamReset}; use frame::{Frame, SettingSet}; use proto::*; -use futures::*; - #[derive(Debug)] pub struct StreamSendOpen { inner: T,