rust upgrade

This commit is contained in:
Sean McArthur
2014-12-12 12:24:54 -08:00
parent 5e560cb1c1
commit 0bba6e80ee
12 changed files with 19 additions and 11 deletions

View File

@@ -1,6 +1,6 @@
use std::fmt::{mod, Show};
use std::str::{FromStr, from_utf8};
use serialize::base64::{ToBase64, FromBase64, Standard, Config};
use serialize::base64::{ToBase64, FromBase64, Standard, Config, Newline};
use header::{Header, HeaderFormat};
/// The `Authorization` header field.
@@ -97,6 +97,7 @@ impl Scheme for Basic {
}
text.as_bytes().to_base64(Config {
char_set: Standard,
newline: Newline::CRLF,
pad: true,
line_length: None
}).fmt(f)

View File

@@ -6,7 +6,7 @@ use super::util::from_one_raw_str;
/// The `Content-Length` header.
///
/// Simply a wrapper around a `uint`.
#[deriving(Clone, PartialEq, Show)]
#[deriving(Copy, Clone, PartialEq, Show)]
pub struct ContentLength(pub uint);
deref!(ContentLength -> uint)

View File

@@ -6,7 +6,7 @@ use super::util::{from_one_raw_str, tm_from_str};
// Egh, replace as soon as something better than time::Tm exists.
/// The `Date` header field.
#[deriving(PartialEq, Clone)]
#[deriving(Copy, PartialEq, Clone)]
pub struct Date(pub Tm);
deref!(Date -> Tm)

View File

@@ -118,7 +118,7 @@ mod tests {
etag = Header::parse_header([b"W/\"\x65\x62\"".to_vec()].as_slice());
assert_eq!(etag, Some(Etag {
weak: true,
tag: "\u0065\u0062".into_string()
tag: "\u{0065}\u{0062}".into_string()
}));
etag = Header::parse_header([b"W/\"\"".to_vec()].as_slice());
@@ -153,4 +153,4 @@ mod tests {
}
}
bench_header!(bench, Etag, { vec![b"W/\"nonemptytag\"".to_vec()] })
bench_header!(bench, Etag, { vec![b"W/\"nonemptytag\"".to_vec()] })

View File

@@ -5,7 +5,7 @@ use header::{Header, HeaderFormat};
use super::util::{from_one_raw_str, tm_from_str};
/// The `Expires` header field.
#[deriving(PartialEq, Clone)]
#[deriving(Copy, PartialEq, Clone)]
pub struct Expires(pub Tm);
deref!(Expires -> Tm)

View File

@@ -5,7 +5,7 @@ use header::{Header, HeaderFormat};
use super::util::{from_one_raw_str, tm_from_str};
/// The `If-Modified-Since` header field.
#[deriving(PartialEq, Clone)]
#[deriving(Copy, PartialEq, Clone)]
pub struct IfModifiedSince(pub Tm);
deref!(IfModifiedSince -> Tm)

View File

@@ -5,7 +5,7 @@ use header::{Header, HeaderFormat};
use super::util::{from_one_raw_str, tm_from_str};
/// The `LastModified` header field.
#[deriving(PartialEq, Clone)]
#[deriving(Copy, PartialEq, Clone)]
pub struct LastModified(pub Tm);
deref!(LastModified -> Tm)