From b84096362933c7079494a5537f4632a6de069ca6 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Thu, 5 May 2016 12:06:44 +0530 Subject: [PATCH] docs(*): Clippy fixes with markdown docs --- src/header/common/cache_control.rs | 2 +- src/header/common/host.rs | 2 +- src/header/common/range.rs | 4 ++-- src/header/mod.rs | 4 ++-- src/net.rs | 28 ++++++++++++++-------------- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/header/common/cache_control.rs b/src/header/common/cache_control.rs index 0629aea2..adbcaf18 100644 --- a/src/header/common/cache_control.rs +++ b/src/header/common/cache_control.rs @@ -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" diff --git a/src/header/common/host.rs b/src/header/common/host.rs index a3de4bcb..7c412532 100644 --- a/src/header/common/host.rs +++ b/src/header/common/host.rs @@ -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 /// ``` diff --git a/src/header/common/range.rs b/src/header/common/range.rs index 49c2d4b5..4eea1bcc 100644 --- a/src/header/common/range.rs +++ b/src/header/common/range.rs @@ -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") diff --git a/src/header/mod.rs b/src/header/mod.rs index 99c633a4..53499f80 100644 --- a/src/header/mod.rs +++ b/src/header/mod.rs @@ -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. /// @@ -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> { diff --git a/src/net.rs b/src/net.rs index c64ce596..315af89f 100644 --- a/src/net.rs +++ b/src/net.rs @@ -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> { @@ -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; @@ -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>; /// Connect to a remote address. @@ -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(&self) -> bool { (*self).get_type() == TypeId::of::() } - /// 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(&self) -> Option<&T> { if self.is::() { @@ -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(&mut self) -> Option<&mut T> { @@ -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(self: Box) -> Result, Box> { @@ -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(&self) -> bool { (*self).get_type() == TypeId::of::() } - /// 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(&self) -> Option<&T> { if self.is::() { @@ -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(&mut self) -> Option<&mut T> { @@ -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(self: Box) -> Result, Box> { @@ -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 { @@ -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 /// @@ -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| {