Fix warnings

This commit is contained in:
Carl Lerche
2017-08-24 15:52:01 -07:00
parent 638791ac6c
commit b0e6867877
26 changed files with 91 additions and 238 deletions

View File

@@ -3,11 +3,10 @@ use hpack;
use frame::{self, Frame, Head, Kind, Error};
use HeaderMap;
use http::{self, request, response, version, uri, Method, StatusCode, Uri};
use http::{Request, Response};
use http::{self, version, uri, Request, Response, Method, StatusCode, Uri};
use http::header::{self, HeaderName, HeaderValue};
use bytes::{BytesMut, Bytes, Buf};
use bytes::{BytesMut, Bytes};
use byteorder::{BigEndian, ByteOrder};
use string::String;
@@ -291,10 +290,6 @@ impl Headers {
Ok(request)
}
pub fn into_fields(self) -> HeaderMap {
self.fields
}
pub fn encode(self, encoder: &mut hpack::Encoder, dst: &mut BytesMut)
-> Option<Continuation>
{

View File

@@ -1,7 +1,7 @@
use hpack;
use error::{ConnectionError, Reason};
use bytes::{Bytes, Buf};
use bytes::Bytes;
use std::fmt;
@@ -56,6 +56,8 @@ pub use self::settings::{
DEFAULT_MAX_FRAME_SIZE,
};
pub type FrameSize = u32;
pub const HEADER_LEN: usize = 9;
pub enum Frame<T = Bytes> {
@@ -100,18 +102,6 @@ impl<T> Frame<T> {
}
}
impl<T: Buf> Frame<T> {
/// Returns the length of the frame as it applies to flow control.
pub fn flow_len(&self) -> usize {
use self::Frame::*;
match *self {
Data(ref frame) => frame.payload().remaining(),
_ => 0,
}
}
}
impl<T> fmt::Debug for Frame<T> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
use self::Frame::*;

View File

@@ -72,12 +72,4 @@ impl StreamDependency {
pub fn dependency_id(&self) -> StreamId {
self.dependency_id
}
pub fn weight(&self) -> u8 {
self.weight
}
pub fn is_exclusive(&self) -> bool {
self.is_exclusive
}
}

View File

@@ -1,5 +1,4 @@
use FrameSize;
use frame::{Frame, Error, Head, Kind, StreamId};
use frame::{Frame, FrameSize, Error, Head, Kind, StreamId};
use bytes::{BytesMut, BufMut, BigEndian};
#[derive(Debug, Clone, Default, Eq, PartialEq)]
@@ -54,10 +53,6 @@ impl Settings {
self.flags.is_ack()
}
pub fn enable_push(&self) -> Option<bool> {
self.enable_push.map(|n| n != 0)
}
pub fn initial_window_size(&self) -> Option<u32> {
self.initial_window_size
}

View File

@@ -1,5 +1,4 @@
use StreamId;
use frame::{self, Head, Kind, Error};
use frame::{self, Head, Kind, Error, StreamId};
use bytes::{BufMut, BigEndian};