Skip to content

Commit

Permalink
Merge pull request hyperium#779 from Manishearth/doc-md
Browse files Browse the repository at this point in the history
Clippy fixes with markdown docs
  • Loading branch information
seanmonstar committed May 5, 2016
2 parents 1d936fe + b840963 commit 6d8fc2e
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/header/common/cache_control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl HeaderFormat for CacheControl {
}
}

/// CacheControl contains a list of these directives.
/// `CacheControl` contains a list of these directives.
#[derive(PartialEq, Clone, Debug)]
pub enum CacheDirective {
/// "no-cache"
Expand Down
2 changes: 1 addition & 1 deletion src/header/common/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use header::parsing::from_one_raw_str;
/// client requests add one automatically.
///
/// Currently is just a String, but it should probably become a better type,
/// like url::Host or something.
/// like `url::Host` or something.
///
/// # Examples
/// ```
Expand Down
4 changes: 2 additions & 2 deletions src/header/common/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ pub enum Range {
Unregistered(String, String)
}

/// Each Range::Bytes header can contain one or more ByteRangeSpecs.
/// Each ByteRangeSpec defines a range of bytes to fetch
/// Each `Range::Bytes` header can contain one or more `ByteRangeSpecs`.
/// Each `ByteRangeSpec` defines a range of bytes to fetch
#[derive(PartialEq, Clone, Debug)]
pub enum ByteRangeSpec {
/// Get all bytes between x and y ("x-y")
Expand Down
4 changes: 2 additions & 2 deletions src/header/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ pub trait Header: Clone + Any + Send + Sync {

/// A trait for any object that will represent a header field and value.
///
/// This trait represents the formatting of a Header for output to a TcpStream.
/// This trait represents the formatting of a `Header` for output to a TcpStream.
pub trait HeaderFormat: fmt::Debug + HeaderClone + Any + Typeable + Send + Sync {
/// Format a header to be output into a TcpStream.
///
Expand Down Expand Up @@ -460,7 +460,7 @@ impl<'a> fmt::Display for &'a (HeaderFormat + Send + Sync) {
///
/// This can be used like so: `format!("{}", HeaderFormatter(&header))` to
/// get the representation of a Header which will be written to an
/// outgoing TcpStream.
/// outgoing `TcpStream`.
pub struct HeaderFormatter<'a, H: HeaderFormat>(pub &'a H);

impl<'a, H: HeaderFormat> fmt::Display for HeaderFormatter<'a, H> {
Expand Down
28 changes: 14 additions & 14 deletions src/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub trait NetworkListener: Clone {
}
}

/// An iterator wrapper over a NetworkAcceptor.
/// An iterator wrapper over a `NetworkAcceptor`.
pub struct NetworkConnections<'a, N: NetworkListener + 'a>(&'a mut N);

impl<'a, N: NetworkListener + 'a> Iterator for NetworkConnections<'a, N> {
Expand All @@ -46,7 +46,7 @@ impl<'a, N: NetworkListener + 'a> Iterator for NetworkConnections<'a, N> {
}
}

/// An abstraction over streams that a Server can utilize.
/// An abstraction over streams that a `Server` can utilize.
pub trait NetworkStream: Read + Write + Any + Send + Typeable {
/// Get the remote address of the underlying connection.
fn peer_addr(&mut self) -> io::Result<SocketAddr>;
Expand Down Expand Up @@ -76,7 +76,7 @@ pub trait NetworkStream: Read + Write + Any + Send + Typeable {

/// A connector creates a NetworkStream.
pub trait NetworkConnector {
/// Type of Stream to create
/// Type of `Stream` to create
type Stream: Into<Box<NetworkStream + Send>>;

/// Connect to a remote address.
Expand Down Expand Up @@ -111,13 +111,13 @@ impl NetworkStream {
}

impl NetworkStream {
/// Is the underlying type in this trait object a T?
/// Is the underlying type in this trait object a `T`?
#[inline]
pub fn is<T: Any>(&self) -> bool {
(*self).get_type() == TypeId::of::<T>()
}

/// If the underlying type is T, get a reference to the contained data.
/// If the underlying type is `T`, get a reference to the contained data.
#[inline]
pub fn downcast_ref<T: Any>(&self) -> Option<&T> {
if self.is::<T>() {
Expand All @@ -127,7 +127,7 @@ impl NetworkStream {
}
}

/// If the underlying type is T, get a mutable reference to the contained
/// If the underlying type is `T`, get a mutable reference to the contained
/// data.
#[inline]
pub fn downcast_mut<T: Any>(&mut self) -> Option<&mut T> {
Expand All @@ -138,7 +138,7 @@ impl NetworkStream {
}
}

/// If the underlying type is T, extract it.
/// If the underlying type is `T`, extract it.
#[inline]
pub fn downcast<T: Any>(self: Box<NetworkStream>)
-> Result<Box<T>, Box<NetworkStream>> {
Expand Down Expand Up @@ -166,13 +166,13 @@ impl NetworkStream + Send {
}

impl NetworkStream + Send {
/// Is the underlying type in this trait object a T?
/// Is the underlying type in this trait object a `T`?
#[inline]
pub fn is<T: Any>(&self) -> bool {
(*self).get_type() == TypeId::of::<T>()
}

/// If the underlying type is T, get a reference to the contained data.
/// If the underlying type is `T`, get a reference to the contained data.
#[inline]
pub fn downcast_ref<T: Any>(&self) -> Option<&T> {
if self.is::<T>() {
Expand All @@ -182,7 +182,7 @@ impl NetworkStream + Send {
}
}

/// If the underlying type is T, get a mutable reference to the contained
/// If the underlying type is `T`, get a mutable reference to the contained
/// data.
#[inline]
pub fn downcast_mut<T: Any>(&mut self) -> Option<&mut T> {
Expand All @@ -193,7 +193,7 @@ impl NetworkStream + Send {
}
}

/// If the underlying type is T, extract it.
/// If the underlying type is `T`, extract it.
#[inline]
pub fn downcast<T: Any>(self: Box<NetworkStream + Send>)
-> Result<Box<T>, Box<NetworkStream + Send>> {
Expand Down Expand Up @@ -270,7 +270,7 @@ impl ::std::os::unix::io::FromRawFd for HttpListener {
}
}

/// A wrapper around a TcpStream.
/// A wrapper around a `TcpStream`.
pub struct HttpStream(pub TcpStream);

impl Clone for HttpStream {
Expand Down Expand Up @@ -381,7 +381,7 @@ impl NetworkConnector for HttpConnector {
}
}

/// A closure as a connector used to generate TcpStreams per request
/// A closure as a connector used to generate `TcpStream`s per request
///
/// # Example
///
Expand All @@ -393,7 +393,7 @@ impl NetworkConnector for HttpConnector {
/// });
/// ```
///
/// Example using TcpBuilder from the net2 crate if you want to configure your source socket:
/// Example using `TcpBuilder` from the net2 crate if you want to configure your source socket:
///
/// ```norun
/// Client::with_connector(|addr: &str, port: u16, scheme: &str| {
Expand Down

0 comments on commit 6d8fc2e

Please sign in to comment.