Skip to content

Commit 9e99c57

Browse files
committed
Merge pull request #195 from hyperium/rustup
rust upgrade
2 parents 5e560cb + 0bba6e8 commit 9e99c57

File tree

12 files changed

+19
-11
lines changed

12 files changed

+19
-11
lines changed

src/header/common/authorization.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::fmt::{mod, Show};
22
use std::str::{FromStr, from_utf8};
3-
use serialize::base64::{ToBase64, FromBase64, Standard, Config};
3+
use serialize::base64::{ToBase64, FromBase64, Standard, Config, Newline};
44
use header::{Header, HeaderFormat};
55

66
/// The `Authorization` header field.
@@ -97,6 +97,7 @@ impl Scheme for Basic {
9797
}
9898
text.as_bytes().to_base64(Config {
9999
char_set: Standard,
100+
newline: Newline::CRLF,
100101
pad: true,
101102
line_length: None
102103
}).fmt(f)

src/header/common/content_length.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use super::util::from_one_raw_str;
66
/// The `Content-Length` header.
77
///
88
/// Simply a wrapper around a `uint`.
9-
#[deriving(Clone, PartialEq, Show)]
9+
#[deriving(Copy, Clone, PartialEq, Show)]
1010
pub struct ContentLength(pub uint);
1111

1212
deref!(ContentLength -> uint)

src/header/common/date.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use super::util::{from_one_raw_str, tm_from_str};
66

77
// Egh, replace as soon as something better than time::Tm exists.
88
/// The `Date` header field.
9-
#[deriving(PartialEq, Clone)]
9+
#[deriving(Copy, PartialEq, Clone)]
1010
pub struct Date(pub Tm);
1111

1212
deref!(Date -> Tm)

src/header/common/etag.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ mod tests {
118118
etag = Header::parse_header([b"W/\"\x65\x62\"".to_vec()].as_slice());
119119
assert_eq!(etag, Some(Etag {
120120
weak: true,
121-
tag: "\u0065\u0062".into_string()
121+
tag: "\u{0065}\u{0062}".into_string()
122122
}));
123123

124124
etag = Header::parse_header([b"W/\"\"".to_vec()].as_slice());
@@ -153,4 +153,4 @@ mod tests {
153153
}
154154
}
155155

156-
bench_header!(bench, Etag, { vec![b"W/\"nonemptytag\"".to_vec()] })
156+
bench_header!(bench, Etag, { vec![b"W/\"nonemptytag\"".to_vec()] })

src/header/common/expires.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use header::{Header, HeaderFormat};
55
use super::util::{from_one_raw_str, tm_from_str};
66

77
/// The `Expires` header field.
8-
#[deriving(PartialEq, Clone)]
8+
#[deriving(Copy, PartialEq, Clone)]
99
pub struct Expires(pub Tm);
1010

1111
deref!(Expires -> Tm)

src/header/common/if_modified_since.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use header::{Header, HeaderFormat};
55
use super::util::{from_one_raw_str, tm_from_str};
66

77
/// The `If-Modified-Since` header field.
8-
#[deriving(PartialEq, Clone)]
8+
#[deriving(Copy, PartialEq, Clone)]
99
pub struct IfModifiedSince(pub Tm);
1010

1111
deref!(IfModifiedSince -> Tm)

src/header/common/last_modified.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use header::{Header, HeaderFormat};
55
use super::util::{from_one_raw_str, tm_from_str};
66

77
/// The `LastModified` header field.
8-
#[deriving(PartialEq, Clone)]
8+
#[deriving(Copy, PartialEq, Clone)]
99
pub struct LastModified(pub Tm);
1010

1111
deref!(LastModified -> Tm)

src/http.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,8 @@ pub const LINE_ENDING: &'static [u8] = &[CR, LF];
285285
/// A `Show`able struct to easily write line endings to a formatter.
286286
pub struct LineEnding;
287287

288+
impl Copy for LineEnding {}
289+
288290
impl fmt::Show for LineEnding {
289291
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
290292
fmt.write(LINE_ENDING)

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ struct Trace;
163163
impl fmt::Show for Trace {
164164
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
165165
let _ = backtrace::write(fmt);
166-
::std::result::Ok(())
166+
Result::Ok(())
167167
}
168168
}
169169

src/net.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ use openssl::ssl::error::{SslError, StreamError, OpenSslErrors, SslSessionClosed
1818
use self::HttpStream::{Http, Https};
1919

2020
/// The write-status indicating headers have not been written.
21+
#[allow(missing_copy_implementations)]
2122
pub struct Fresh;
2223

2324
/// The write-status indicating headers have been written.
25+
#[allow(missing_copy_implementations)]
2426
pub struct Streaming;
2527

2628
/// An abstraction to listen for connections on a certain port.
@@ -236,6 +238,7 @@ impl NetworkStream for HttpStream {
236238
}
237239

238240
/// A connector that will produce HttpStreams.
241+
#[allow(missing_copy_implementations)]
239242
pub struct HttpConnector;
240243

241244
impl NetworkConnector<HttpStream> for HttpConnector {

src/status.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1569,6 +1569,8 @@ impl StatusCode {
15691569
}
15701570
}
15711571

1572+
impl Copy for StatusCode {}
1573+
15721574
/// Formats the status code, *including* the canonical reason.
15731575
///
15741576
/// ```rust
@@ -1684,7 +1686,7 @@ impl ToPrimitive for StatusCode {
16841686
/// to get the appropriate *category* of status.
16851687
///
16861688
/// For HTTP/2.0, the 1xx Informational class is invalid.
1687-
#[deriving(Clone, PartialEq, Eq, PartialOrd, Ord)]
1689+
#[deriving(Clone, PartialEq, Eq, PartialOrd, Ord, Copy)]
16881690
pub enum StatusClass {
16891691
/// 1xx: Informational - Request received, continuing process
16901692
Informational = 100,

src/version.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::fmt;
77
use self::HttpVersion::{Http09, Http10, Http11, Http20};
88

99
/// Represents a version of the HTTP spec.
10-
#[deriving(PartialEq, PartialOrd)]
10+
#[deriving(PartialEq, PartialOrd, Copy)]
1111
pub enum HttpVersion {
1212
/// `HTTP/0.9`
1313
Http09,

0 commit comments

Comments
 (0)