docs(lib): fix rustdoc warnings

This commit is contained in:
Guillaume Gomez
2017-11-10 19:22:33 +01:00
committed by Sean McArthur
parent fe38aa4bc1
commit e330d30964
55 changed files with 237 additions and 72 deletions

View File

@@ -9,7 +9,9 @@ use self::Charset::*;
///
/// The string representation is normalised to upper case.
///
/// See http://www.iana.org/assignments/character-sets/character-sets.xhtml
/// See [http://www.iana.org/assignments/character-sets/character-sets.xhtml][url].
///
/// [url]: http://www.iana.org/assignments/character-sets/character-sets.xhtml
#[derive(Clone,Debug,PartialEq)]
#[allow(non_camel_case_types)]
pub enum Charset{

View File

@@ -1,10 +1,10 @@
use std::str::FromStr;
use std::fmt::{self, Display};
// check that each char in the slice is either:
// 1. %x21, or
// 2. in the range %x23 to %x7E, or
// 3. above %x80
/// check that each char in the slice is either:
/// 1. `%x21`, or
/// 2. in the range `%x23` to `%x7E`, or
/// 3. above `%x80`
fn check_slice_validity(slice: &str) -> bool {
slice.bytes().all(|c|
c == b'\x21' || (c >= b'\x23' && c <= b'\x7e') | (c >= b'\x80'))
@@ -17,7 +17,8 @@ fn check_slice_validity(slice: &str) -> bool {
/// which always looks like `W/`. Examples for valid tags are `"xyzzy"` and `W/"xyzzy"`.
///
/// # ABNF
/// ```plain
///
/// ```text
/// entity-tag = [ weak ] opaque-tag
/// weak = %x57.2F ; "W/", case-sensitive
/// opaque-tag = DQUOTE *etagc DQUOTE