Skip to content

Commit 6d8fc2e

Browse files
committed
Merge pull request #779 from Manishearth/doc-md
Clippy fixes with markdown docs
2 parents 1d936fe + b840963 commit 6d8fc2e

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

src/header/common/cache_control.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ impl HeaderFormat for CacheControl {
7070
}
7171
}
7272

73-
/// CacheControl contains a list of these directives.
73+
/// `CacheControl` contains a list of these directives.
7474
#[derive(PartialEq, Clone, Debug)]
7575
pub enum CacheDirective {
7676
/// "no-cache"

src/header/common/host.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use header::parsing::from_one_raw_str;
88
/// client requests add one automatically.
99
///
1010
/// Currently is just a String, but it should probably become a better type,
11-
/// like url::Host or something.
11+
/// like `url::Host` or something.
1212
///
1313
/// # Examples
1414
/// ```

src/header/common/range.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ pub enum Range {
6464
Unregistered(String, String)
6565
}
6666

67-
/// Each Range::Bytes header can contain one or more ByteRangeSpecs.
68-
/// Each ByteRangeSpec defines a range of bytes to fetch
67+
/// Each `Range::Bytes` header can contain one or more `ByteRangeSpecs`.
68+
/// Each `ByteRangeSpec` defines a range of bytes to fetch
6969
#[derive(PartialEq, Clone, Debug)]
7070
pub enum ByteRangeSpec {
7171
/// Get all bytes between x and y ("x-y")

src/header/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ pub trait Header: Clone + Any + Send + Sync {
131131

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

466466
impl<'a, H: HeaderFormat> fmt::Display for HeaderFormatter<'a, H> {

src/net.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub trait NetworkListener: Clone {
3636
}
3737
}
3838

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

4242
impl<'a, N: NetworkListener + 'a> Iterator for NetworkConnections<'a, N> {
@@ -46,7 +46,7 @@ impl<'a, N: NetworkListener + 'a> Iterator for NetworkConnections<'a, N> {
4646
}
4747
}
4848

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

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

8282
/// Connect to a remote address.
@@ -111,13 +111,13 @@ impl NetworkStream {
111111
}
112112

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

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

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

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

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

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

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

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

273-
/// A wrapper around a TcpStream.
273+
/// A wrapper around a `TcpStream`.
274274
pub struct HttpStream(pub TcpStream);
275275

276276
impl Clone for HttpStream {
@@ -381,7 +381,7 @@ impl NetworkConnector for HttpConnector {
381381
}
382382
}
383383

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

0 commit comments

Comments
 (0)