From 7f3a33f903aca3d5eced9b465624ea44e4773ce3 Mon Sep 17 00:00:00 2001 From: Jonathan Reem Date: Sat, 3 Jan 2015 13:15:54 +0100 Subject: [PATCH] #[deriving] -> #[derive] --- benches/client.rs | 2 +- benches/client_mock_tcp.rs | 2 +- src/client/mod.rs | 2 +- src/header/common/accept.rs | 2 +- src/header/common/allow.rs | 2 +- src/header/common/authorization.rs | 4 ++-- src/header/common/cache_control.rs | 4 ++-- src/header/common/connection.rs | 4 ++-- src/header/common/content_length.rs | 2 +- src/header/common/content_type.rs | 2 +- src/header/common/cookie.rs | 2 +- src/header/common/date.rs | 2 +- src/header/common/etag.rs | 2 +- src/header/common/expires.rs | 2 +- src/header/common/host.rs | 2 +- src/header/common/if_modified_since.rs | 2 +- src/header/common/last_modified.rs | 2 +- src/header/common/location.rs | 2 +- src/header/common/server.rs | 2 +- src/header/common/set_cookie.rs | 2 +- src/header/common/transfer_encoding.rs | 4 ++-- src/header/common/upgrade.rs | 4 ++-- src/header/common/user_agent.rs | 2 +- src/header/common/vary.rs | 2 +- src/header/mod.rs | 8 ++++---- src/http.rs | 2 +- src/lib.rs | 2 +- src/method.rs | 2 +- src/net.rs | 4 ++-- src/status.rs | 6 +++--- src/uri.rs | 2 +- src/version.rs | 2 +- 32 files changed, 43 insertions(+), 43 deletions(-) diff --git a/benches/client.rs b/benches/client.rs index 6bcee6fb..c8a88639 100644 --- a/benches/client.rs +++ b/benches/client.rs @@ -46,7 +46,7 @@ fn bench_curl(b: &mut test::Bencher) { listening.close().unwrap(); } -#[deriving(Clone)] +#[derive(Clone)] struct Foo; impl hyper::header::Header for Foo { diff --git a/benches/client_mock_tcp.rs b/benches/client_mock_tcp.rs index 2fd2ce19..599206ec 100644 --- a/benches/client_mock_tcp.rs +++ b/benches/client_mock_tcp.rs @@ -65,7 +65,7 @@ fn bench_mock_curl(b: &mut test::Bencher) { }); } -#[deriving(Clone)] +#[derive(Clone)] struct Foo; impl hyper::header::Header for Foo { diff --git a/src/client/mod.rs b/src/client/mod.rs index 04bd8ef4..3eddc4b3 100644 --- a/src/client/mod.rs +++ b/src/client/mod.rs @@ -315,7 +315,7 @@ impl<'a> IntoUrl for &'a str { } /// Behavior regarding how to handle redirects within a Client. -#[deriving(Copy)] +#[derive(Copy)] pub enum RedirectPolicy { /// Don't follow any redirects. FollowNone, diff --git a/src/header/common/accept.rs b/src/header/common/accept.rs index 3617f6ee..79e2252f 100644 --- a/src/header/common/accept.rs +++ b/src/header/common/accept.rs @@ -25,7 +25,7 @@ use mime; /// qitem(Mime(Text, Html, vec![])), /// qitem(Mime(Text, Xml, vec![])) ])); /// ``` -#[deriving(Clone, PartialEq, Show)] +#[derive(Clone, PartialEq, Show)] pub struct Accept(pub Vec>); deref!(Accept -> Vec>); diff --git a/src/header/common/allow.rs b/src/header/common/allow.rs index 0efad670..dcd4bc28 100644 --- a/src/header/common/allow.rs +++ b/src/header/common/allow.rs @@ -6,7 +6,7 @@ use header::shared::util::{from_comma_delimited, fmt_comma_delimited}; /// The `Allow` header. /// See also https://tools.ietf.org/html/rfc7231#section-7.4.1 -#[deriving(Clone, PartialEq, Show)] +#[derive(Clone, PartialEq, Show)] pub struct Allow(pub Vec); deref!(Allow -> Vec); diff --git a/src/header/common/authorization.rs b/src/header/common/authorization.rs index 0b69d4d4..d6daa17e 100644 --- a/src/header/common/authorization.rs +++ b/src/header/common/authorization.rs @@ -4,7 +4,7 @@ use serialize::base64::{ToBase64, FromBase64, Standard, Config, Newline}; use header::{Header, HeaderFormat}; /// The `Authorization` header field. -#[deriving(Clone, PartialEq, Show)] +#[derive(Clone, PartialEq, Show)] pub struct Authorization(pub S); impl Deref for Authorization { @@ -72,7 +72,7 @@ impl Scheme for String { } /// Credential holder for Basic Authentication -#[deriving(Clone, PartialEq, Show)] +#[derive(Clone, PartialEq, Show)] pub struct Basic { /// The username as a possibly empty string pub username: String, diff --git a/src/header/common/cache_control.rs b/src/header/common/cache_control.rs index 8c309dff..0cb0dbef 100644 --- a/src/header/common/cache_control.rs +++ b/src/header/common/cache_control.rs @@ -4,7 +4,7 @@ use header::{Header, HeaderFormat}; use header::shared::util::{from_one_comma_delimited, fmt_comma_delimited}; /// The Cache-Control header. -#[deriving(PartialEq, Clone, Show)] +#[derive(PartialEq, Clone, Show)] pub struct CacheControl(pub Vec); deref!(CacheControl -> Vec); @@ -34,7 +34,7 @@ impl HeaderFormat for CacheControl { } /// CacheControl contains a list of these directives. -#[deriving(PartialEq, Clone)] +#[derive(PartialEq, Clone)] pub enum CacheDirective { /// "no-cache" NoCache, diff --git a/src/header/common/connection.rs b/src/header/common/connection.rs index ad2ce2b6..1c29f47f 100644 --- a/src/header/common/connection.rs +++ b/src/header/common/connection.rs @@ -6,13 +6,13 @@ use header::shared::util::{from_comma_delimited, fmt_comma_delimited}; pub use self::ConnectionOption::{KeepAlive, Close, ConnectionHeader}; /// The `Connection` header. -#[deriving(Clone, PartialEq, Show)] +#[derive(Clone, PartialEq, Show)] pub struct Connection(pub Vec); deref!(Connection -> Vec); /// Values that can be in the `Connection` header. -#[deriving(Clone, PartialEq)] +#[derive(Clone, PartialEq)] pub enum ConnectionOption { /// The `keep-alive` connection value. KeepAlive, diff --git a/src/header/common/content_length.rs b/src/header/common/content_length.rs index 3637d02b..cd73bae2 100644 --- a/src/header/common/content_length.rs +++ b/src/header/common/content_length.rs @@ -6,7 +6,7 @@ use header::shared::util::from_one_raw_str; /// The `Content-Length` header. /// /// Simply a wrapper around a `uint`. -#[deriving(Copy, Clone, PartialEq, Show)] +#[derive(Copy, Clone, PartialEq, Show)] pub struct ContentLength(pub uint); deref!(ContentLength -> uint); diff --git a/src/header/common/content_type.rs b/src/header/common/content_type.rs index d07c3542..fb5af41f 100644 --- a/src/header/common/content_type.rs +++ b/src/header/common/content_type.rs @@ -7,7 +7,7 @@ use mime::Mime; /// /// Used to describe the MIME type of message body. Can be used with both /// requests and responses. -#[deriving(Clone, PartialEq, Show)] +#[derive(Clone, PartialEq, Show)] pub struct ContentType(pub Mime); deref!(ContentType -> Mime); diff --git a/src/header/common/cookie.rs b/src/header/common/cookie.rs index 09c8b146..039f0e9a 100644 --- a/src/header/common/cookie.rs +++ b/src/header/common/cookie.rs @@ -13,7 +13,7 @@ use cookie::CookieJar; /// /// > When the user agent generates an HTTP request, the user agent MUST NOT /// > attach more than one Cookie header field. -#[deriving(Clone, PartialEq, Show)] +#[derive(Clone, PartialEq, Show)] pub struct Cookies(pub Vec); //TODO: remove when fixed in libstd diff --git a/src/header/common/date.rs b/src/header/common/date.rs index 9398cefe..9dab54b6 100644 --- a/src/header/common/date.rs +++ b/src/header/common/date.rs @@ -7,7 +7,7 @@ use header::shared::time::tm_from_str; // Egh, replace as soon as something better than time::Tm exists. /// The `Date` header field. -#[deriving(Copy, PartialEq, Clone)] +#[derive(Copy, PartialEq, Clone)] pub struct Date(pub Tm); deref!(Date -> Tm); diff --git a/src/header/common/etag.rs b/src/header/common/etag.rs index 3bdd3a6b..d6c4eebf 100644 --- a/src/header/common/etag.rs +++ b/src/header/common/etag.rs @@ -8,7 +8,7 @@ use header::shared::util::from_one_raw_str; /// Preceding the first double quote is an optional weakness indicator, /// which always looks like this: W/ /// See also: https://tools.ietf.org/html/rfc7232#section-2.3 -#[deriving(Clone, PartialEq, Show)] +#[derive(Clone, PartialEq, Show)] pub struct Etag { /// Weakness indicator for the tag pub weak: bool, diff --git a/src/header/common/expires.rs b/src/header/common/expires.rs index 4f160ded..4933fbe0 100644 --- a/src/header/common/expires.rs +++ b/src/header/common/expires.rs @@ -6,7 +6,7 @@ use header::shared::util::from_one_raw_str; use header::shared::time::tm_from_str; /// The `Expires` header field. -#[deriving(Copy, PartialEq, Clone)] +#[derive(Copy, PartialEq, Clone)] pub struct Expires(pub Tm); deref!(Expires -> Tm); diff --git a/src/header/common/host.rs b/src/header/common/host.rs index 7298fa51..90759bae 100644 --- a/src/header/common/host.rs +++ b/src/header/common/host.rs @@ -10,7 +10,7 @@ use header::shared::util::from_one_raw_str; /// /// Currently is just a String, but it should probably become a better type, /// like url::Host or something. -#[deriving(Clone, PartialEq, Show)] +#[derive(Clone, PartialEq, Show)] pub struct Host { /// The hostname, such a example.domain. pub hostname: String, diff --git a/src/header/common/if_modified_since.rs b/src/header/common/if_modified_since.rs index a462ed54..565c98ce 100644 --- a/src/header/common/if_modified_since.rs +++ b/src/header/common/if_modified_since.rs @@ -6,7 +6,7 @@ use header::shared::util::from_one_raw_str; use header::shared::time::tm_from_str; /// The `If-Modified-Since` header field. -#[deriving(Copy, PartialEq, Clone)] +#[derive(Copy, PartialEq, Clone)] pub struct IfModifiedSince(pub Tm); deref!(IfModifiedSince -> Tm); diff --git a/src/header/common/last_modified.rs b/src/header/common/last_modified.rs index 5369ae4d..73a5d2c0 100644 --- a/src/header/common/last_modified.rs +++ b/src/header/common/last_modified.rs @@ -6,7 +6,7 @@ use header::shared::util::from_one_raw_str; use header::shared::time::tm_from_str; /// The `LastModified` header field. -#[deriving(Copy, PartialEq, Clone)] +#[derive(Copy, PartialEq, Clone)] pub struct LastModified(pub Tm); deref!(LastModified -> Tm); diff --git a/src/header/common/location.rs b/src/header/common/location.rs index 31fdc962..c8ee186a 100644 --- a/src/header/common/location.rs +++ b/src/header/common/location.rs @@ -13,7 +13,7 @@ use header::shared::util::from_one_raw_str; /// /// Currently is just a String, but it should probably become a better type, /// like url::Url or something. -#[deriving(Clone, PartialEq, Show)] +#[derive(Clone, PartialEq, Show)] pub struct Location(pub String); deref!(Location -> String); diff --git a/src/header/common/server.rs b/src/header/common/server.rs index a7d5d4ed..9e835299 100644 --- a/src/header/common/server.rs +++ b/src/header/common/server.rs @@ -5,7 +5,7 @@ use header::shared::util::from_one_raw_str; /// The `Server` header field. /// /// They can contain any value, so it just wraps a `String`. -#[deriving(Clone, PartialEq, Show)] +#[derive(Clone, PartialEq, Show)] pub struct Server(pub String); deref!(Server -> String); diff --git a/src/header/common/set_cookie.rs b/src/header/common/set_cookie.rs index 4bec8724..0b0a3912 100644 --- a/src/header/common/set_cookie.rs +++ b/src/header/common/set_cookie.rs @@ -10,7 +10,7 @@ use cookie::CookieJar; /// Informally, the Set-Cookie response header contains the header name /// "Set-Cookie" followed by a ":" and a cookie. Each cookie begins with /// a name-value-pair, followed by zero or more attribute-value pairs. -#[deriving(Clone, PartialEq, Show)] +#[derive(Clone, PartialEq, Show)] pub struct SetCookie(pub Vec); //TODO: remove when fixed in libstd diff --git a/src/header/common/transfer_encoding.rs b/src/header/common/transfer_encoding.rs index 47c4ad50..480a559c 100644 --- a/src/header/common/transfer_encoding.rs +++ b/src/header/common/transfer_encoding.rs @@ -18,7 +18,7 @@ use self::Encoding::{Chunked, Gzip, Deflate, Compress, EncodingExt}; /// this header should include `chunked` as the last encoding. /// /// The implementation uses a vector of `Encoding` values. -#[deriving(Clone, PartialEq, Show)] +#[derive(Clone, PartialEq, Show)] pub struct TransferEncoding(pub Vec); deref!(TransferEncoding -> Vec); @@ -33,7 +33,7 @@ deref!(TransferEncoding -> Vec); /// # use hyper::header::Headers; /// # let mut headers = Headers::new(); /// headers.set(TransferEncoding(vec![Gzip, Chunked])); -#[deriving(Clone, PartialEq)] +#[derive(Clone, PartialEq)] pub enum Encoding { /// The `chunked` encoding. Chunked, diff --git a/src/header/common/upgrade.rs b/src/header/common/upgrade.rs index 10c6009b..365ddcc4 100644 --- a/src/header/common/upgrade.rs +++ b/src/header/common/upgrade.rs @@ -6,13 +6,13 @@ use header::shared::util::{from_comma_delimited, fmt_comma_delimited}; use self::Protocol::{WebSocket, ProtocolExt}; /// The `Upgrade` header. -#[deriving(Clone, PartialEq, Show)] +#[derive(Clone, PartialEq, Show)] pub struct Upgrade(pub Vec); deref!(Upgrade -> Vec); /// Protocol values that can appear in the Upgrade header. -#[deriving(Clone, PartialEq)] +#[derive(Clone, PartialEq)] pub enum Protocol { /// The websocket protocol. WebSocket, diff --git a/src/header/common/user_agent.rs b/src/header/common/user_agent.rs index a51bee3c..d0d80999 100644 --- a/src/header/common/user_agent.rs +++ b/src/header/common/user_agent.rs @@ -5,7 +5,7 @@ use header::shared::util::from_one_raw_str; /// The `User-Agent` header field. /// /// They can contain any value, so it just wraps a `String`. -#[deriving(Clone, PartialEq, Show)] +#[derive(Clone, PartialEq, Show)] pub struct UserAgent(pub String); deref!(UserAgent -> String); diff --git a/src/header/common/vary.rs b/src/header/common/vary.rs index 1424c278..97497f49 100644 --- a/src/header/common/vary.rs +++ b/src/header/common/vary.rs @@ -5,7 +5,7 @@ use header::shared::util::{from_comma_delimited, fmt_comma_delimited, from_one_r /// The `Allow` header. /// See also https://tools.ietf.org/html/rfc7231#section-7.1.4 -#[deriving(Clone, PartialEq, Show)] +#[derive(Clone, PartialEq, Show)] pub enum Vary { /// This corresponds to '*'. Any, diff --git a/src/header/mod.rs b/src/header/mod.rs index ba308727..e6c0fe80 100644 --- a/src/header/mod.rs +++ b/src/header/mod.rs @@ -110,7 +110,7 @@ fn header_name() -> &'static str { } /// A map of header fields on requests and responses. -#[deriving(Clone)] +#[derive(Clone)] pub struct Headers { data: HashMap> } @@ -342,7 +342,7 @@ impl<'a> FromIterator> for Headers { } } -#[deriving(Clone)] +#[derive(Clone)] struct Item { raw: Option>>, typed: Option> @@ -450,7 +450,7 @@ impl fmt::Show for Box { } /// Case-insensitive string. -//#[deriving(Clone)] +//#[derive(Clone)] pub struct CaseInsensitive(SendStr); impl FromStr for CaseInsensitive { @@ -562,7 +562,7 @@ mod tests { assert_eq!(accept, Some(Accept(vec![application_vendor, text_plain]))); } - #[deriving(Clone, Show)] + #[derive(Clone, Show)] struct CrazyLength(Option, uint); impl Header for CrazyLength { diff --git a/src/http.rs b/src/http.rs index 33f2cda7..074bb021 100644 --- a/src/http.rs +++ b/src/http.rs @@ -582,7 +582,7 @@ pub fn read_request_line(stream: &mut R) -> HttpResult { pub type StatusLine = (HttpVersion, RawStatus); /// The raw status code and reason-phrase. -#[deriving(PartialEq, Show)] +#[derive(PartialEq, Show)] pub struct RawStatus(pub u16, pub SendStr); impl Clone for RawStatus { diff --git a/src/lib.rs b/src/lib.rs index 27eec2ec..6377a631 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -207,7 +207,7 @@ mod mimewrapper { pub type HttpResult = Result; /// A set of errors that can occur parsing HTTP streams. -#[deriving(Show, PartialEq, Clone)] +#[derive(Show, PartialEq, Clone)] pub enum HttpError { /// An invalid `Method`, such as `GE,T`. HttpMethodError, diff --git a/src/method.rs b/src/method.rs index 41d53d27..b49524f7 100644 --- a/src/method.rs +++ b/src/method.rs @@ -13,7 +13,7 @@ use self::Method::{Options, Get, Post, Put, Delete, Head, Trace, Connect, Patch, /// /// It may make sense to grow this to include all variants currently /// registered with IANA, if they are at all common to use. -#[deriving(Clone, PartialEq, Eq, Hash)] +#[derive(Clone, PartialEq, Eq, Hash)] pub enum Method { /// OPTIONS Options, diff --git a/src/net.rs b/src/net.rs index 63acf3c0..420e807d 100644 --- a/src/net.rs +++ b/src/net.rs @@ -182,7 +182,7 @@ impl NetworkListener for HttpListener { } /// A `NetworkAcceptor` for `HttpStream`s. -#[deriving(Clone)] +#[derive(Clone)] pub struct HttpAcceptor { inner: TcpAcceptor } @@ -202,7 +202,7 @@ impl NetworkAcceptor for HttpAcceptor { } /// A wrapper around a TcpStream. -#[deriving(Clone)] +#[derive(Clone)] pub enum HttpStream { /// A stream over the HTTP protocol. Http(TcpStream), diff --git a/src/status.rs b/src/status.rs index 189d29b7..4f25c584 100644 --- a/src/status.rs +++ b/src/status.rs @@ -1038,7 +1038,7 @@ impl StatusCode { /// other times. /// /// The reason phrase is defined as being exclusively for human readers. You should avoid - /// deriving any meaning from it at all costs. + /// derive any meaning from it at all costs. /// /// Bear in mind also that in HTTP/2.0 the reason phrase is abolished from transmission, and so /// this canonical reason phrase really is the only reason phrase you’ll find. @@ -1600,7 +1600,7 @@ impl PartialEq for StatusCode { impl Eq for StatusCode {} -// Ditto (though #[deriving(Clone)] only takes about 0.4 seconds). +// Ditto (though #[derive(Clone)] only takes about 0.4 seconds). impl Clone for StatusCode { #[inline] fn clone(&self) -> StatusCode { @@ -1686,7 +1686,7 @@ impl ToPrimitive for StatusCode { /// to get the appropriate *category* of status. /// /// For HTTP/2.0, the 1xx Informational class is invalid. -#[deriving(Clone, PartialEq, Eq, PartialOrd, Ord, Copy)] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Copy)] pub enum StatusClass { /// 1xx: Informational - Request received, continuing process Informational = 100, diff --git a/src/uri.rs b/src/uri.rs index 89fd92bf..7b0f80a9 100644 --- a/src/uri.rs +++ b/src/uri.rs @@ -16,7 +16,7 @@ use url::Url; /// > / authority-form /// > / asterisk-form /// > ``` -#[deriving(Show, PartialEq, Clone)] +#[derive(Show, PartialEq, Clone)] pub enum RequestUri { /// The most common request target, an absolute path and optional query. /// diff --git a/src/version.rs b/src/version.rs index d0ec828f..b0a7efa6 100644 --- a/src/version.rs +++ b/src/version.rs @@ -7,7 +7,7 @@ use std::fmt; use self::HttpVersion::{Http09, Http10, Http11, Http20}; /// Represents a version of the HTTP spec. -#[deriving(PartialEq, PartialOrd, Copy)] +#[derive(PartialEq, PartialOrd, Copy)] pub enum HttpVersion { /// `HTTP/0.9` Http09,