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:
committed by
Sean McArthur
parent
0d05533d07
commit
2fa414fb5f
@@ -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"]);
|
||||
|
||||
@@ -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.
|
||||
///
|
||||
|
||||
@@ -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".
|
||||
|
||||
@@ -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));
|
||||
|
||||
|
||||
@@ -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])))
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -476,7 +476,7 @@ impl Headers {
|
||||
///
|
||||
/// If a header already contains a value, this will add another line to it.
|
||||
///
|
||||
/// If a header doesnot exist for this name, a new one will be created with
|
||||
/// If a header does not exist for this name, a new one will be created with
|
||||
/// the value.
|
||||
///
|
||||
/// Example:
|
||||
|
||||
@@ -114,7 +114,7 @@ fn from_f32(f: f32) -> Quality {
|
||||
Quality((f * 1000f32) as u16)
|
||||
}
|
||||
|
||||
/// Convinience function to wrap a value in a `QualityItem`
|
||||
/// Convenience function to wrap a value in a `QualityItem`
|
||||
/// Sets `q` to the default 1.0
|
||||
pub fn qitem<T>(item: T) -> QualityItem<T> {
|
||||
QualityItem::new(item, Default::default())
|
||||
|
||||
Reference in New Issue
Block a user