Skip to content

Commit aa46020

Browse files
committed
updating comments
1 parent 0879ada commit aa46020

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

src/common/accept_encoding.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,19 @@ derive_header! {
3131
}
3232

3333
impl AcceptEncoding {
34-
/// Convience method
34+
/// Convience method to create an `Accept-Encoding: gzip` header
3535
#[inline]
3636
pub fn gzip() -> AcceptEncoding {
3737
AcceptEncoding(HeaderValue::from_static("gzip").into())
3838
}
3939

4040
/// A convience method to create an Accept-Encoding header from pairs of values and qualities
41-
///
42-
/// # Example
43-
///
41+
///
42+
/// # Example
43+
///
4444
/// ```
4545
/// use headers::AcceptEncoding;
46-
///
46+
///
4747
/// let pairs = vec![("gzip", 1.0), ("deflate", 0.8)];
4848
/// let header = AcceptEncoding::from_quality_pairs(&mut pairs.into_iter());
4949
/// ```
@@ -60,7 +60,7 @@ impl AcceptEncoding {
6060
Ok(AcceptEncoding(value))
6161
}
6262

63-
/// Returns the most prefered encoding that is specified by the client,
63+
/// Returns the most prefered encoding that is specified by the header,
6464
/// if one is specified.
6565
///
6666
/// Note: This peeks at the underlying iter, not modifying it.

src/util/quality_value.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ use itertools::Itertools;
66
use util::{FlatCsv, TryFromValues};
77
use HeaderValue;
88

9+
/// A CSV list that respects the Quality Values syntax defined in
10+
/// [RFC7321](https://tools.ietf.org/html/rfc7231#section-5.3.1)
11+
///
12+
/// Many of the request header fields for proactive negotiation use a
13+
/// common parameter, named "q" (case-insensitive), to assign a relative
14+
/// "weight" to the preference for that associated kind of content. This
15+
/// weight is referred to as a "quality value" (or "qvalue") because the
16+
/// same parameter name is often used within server configurations to
17+
/// assign a weight to the relative quality of the various
18+
/// representations that can be selected for a resource.
19+
///
920
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
1021
pub(crate) struct QualityValue<QualSep = SemiQ> {
1122
csv: FlatCsv,

0 commit comments

Comments
 (0)