fix(lib): Fixed typos in multiple modules

BREAKING CHANGE: The `Preference` header had a typo in a variant and it's string representation,
  change `Preference::HandlingLeniant` to `Preference::HandlingLenient`.
This commit is contained in:
Julian Tescher
2017-02-07 11:04:42 -08:00
committed by Sean McArthur
parent 0d05533d07
commit 2fa414fb5f
15 changed files with 22 additions and 22 deletions

View File

@@ -88,7 +88,7 @@ impl Display for AccessControlAllowOrigin {
}
#[cfg(test)]
mod test_access_control_allow_orgin {
mod test_access_control_allow_origin {
use header::*;
use super::AccessControlAllowOrigin as HeaderField;
test_header!(test1, vec![b"null"]);

View File

@@ -3,7 +3,7 @@ header! {
/// [RFC7231](https://tools.ietf.org/html/rfc7231#section-3.1.4.2)
///
/// The header can be used by both the client in requests and the server
/// in resposes with different semantics. Client sets `Content-Location`
/// in responses with different semantics. Client sets `Content-Location`
/// to refer to the URI where original representation of the body was
/// obtained.
///

View File

@@ -7,7 +7,7 @@ header! {
/// track of event state. This is helpful when working
/// with [Server-Sent-Events](http://www.html5rocks.com/en/tutorials/eventsource/basics/). If the connection were to be dropped, for example, it'd
/// be useful to let the server know what the last event you
/// recieved was.
/// received was.
///
/// The spec is a String with the id of the last event, it can be
/// an empty string which acts a sort of "reset".

View File

@@ -71,7 +71,7 @@ impl FromStr for Origin {
Some(idx) => idx,
None => return Err(::Error::Header)
};
// idx + 3 because thats how long "://" is
// idx + 3 because that's how long "://" is
let (scheme, etc) = (&s[..idx], &s[idx + 3..]);
let host = try!(Host::from_str(etc));

View File

@@ -87,8 +87,8 @@ pub enum Preference {
ReturnMinimal,
/// "handling=strict"
HandlingStrict,
/// "handling=leniant"
HandlingLeniant,
/// "handling=lenient"
HandlingLenient,
/// "wait=delta"
Wait(u32),
@@ -105,7 +105,7 @@ impl fmt::Display for Preference {
ReturnRepresentation => "return=representation",
ReturnMinimal => "return=minimal",
HandlingStrict => "handling=strict",
HandlingLeniant => "handling=leniant",
HandlingLenient => "handling=lenient",
Wait(secs) => return write!(f, "wait={}", secs),
@@ -148,7 +148,7 @@ impl FromStr for Preference {
("return", "representation") => if rest.is_empty() { Ok(ReturnRepresentation) } else { Err(None) },
("return", "minimal") => if rest.is_empty() { Ok(ReturnMinimal) } else { Err(None) },
("handling", "strict") => if rest.is_empty() { Ok(HandlingStrict) } else { Err(None) },
("handling", "leniant") => if rest.is_empty() { Ok(HandlingLeniant) } else { Err(None) },
("handling", "lenient") => if rest.is_empty() { Ok(HandlingLenient) } else { Err(None) },
("wait", secs) => if rest.is_empty() { secs.parse().map(Wait).map_err(Some) } else { Err(None) },
(left, right) => Ok(Extension(left.to_owned(), right.to_owned(), rest))
}
@@ -172,9 +172,9 @@ mod tests {
#[test]
fn test_parse_argument() {
let prefer = Header::parse_header(&"wait=100, handling=leniant, respond-async".into());
let prefer = Header::parse_header(&"wait=100, handling=lenient, respond-async".into());
assert_eq!(prefer.ok(), Some(Prefer(vec![Preference::Wait(100),
Preference::HandlingLeniant,
Preference::HandlingLenient,
Preference::RespondAsync])))
}

View File

@@ -74,7 +74,7 @@ header! {
}
}
/// A protocol name used to identify a spefic protocol. Names are case-sensitive
/// A protocol name used to identify a specific protocol. Names are case-sensitive
/// except for the `WebSocket` value.
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum ProtocolName {