Skip to content

Commit 6c9ed80

Browse files
committed
Merge pull request #269 from hyperium/rustup
fix(rustup): update to newest fmt trait names and slice syntax
2 parents bb4f913 + 9e3c94d commit 6c9ed80

38 files changed

+90
-114
lines changed

benches/client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ extern crate hyper;
33

44
extern crate test;
55

6-
use std::fmt::{self, Show};
6+
use std::fmt;
77
use std::io::net::ip::Ipv4Addr;
88
use hyper::server::{Request, Response, Server};
99
use hyper::header::Headers;
@@ -44,7 +44,7 @@ impl hyper::header::Header for Foo {
4444

4545
impl hyper::header::HeaderFormat for Foo {
4646
fn fmt_header(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
47-
"Bar".fmt(fmt)
47+
fmt.write_str("Bar")
4848
}
4949
}
5050

benches/client_mock_tcp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ extern crate hyper;
33

44
extern crate test;
55

6-
use std::fmt::{self, Show};
6+
use std::fmt;
77
use std::io::{IoResult, MemReader};
88
use std::io::net::ip::SocketAddr;
99

@@ -60,7 +60,7 @@ impl hyper::header::Header for Foo {
6060

6161
impl hyper::header::HeaderFormat for Foo {
6262
fn fmt_header(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
63-
"Bar".fmt(fmt)
63+
fmt.write_str("Bar")
6464
}
6565
}
6666

src/header/common/accept.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use mime;
2525
/// qitem(Mime(Text, Html, vec![])),
2626
/// qitem(Mime(Text, Xml, vec![])) ]));
2727
/// ```
28-
#[derive(Clone, PartialEq, Show)]
28+
#[derive(Clone, PartialEq, Debug)]
2929
pub struct Accept(pub Vec<header::QualityItem<mime::Mime>>);
3030

3131
deref!(Accept => Vec<header::QualityItem<mime::Mime>>);

src/header/common/accept_encoding.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use header::{self, Encoding, QualityItem};
44
///
55
/// The `Accept-Encoding` header can be used by clients to indicate what
66
/// response encodings they accept.
7-
#[derive(Clone, PartialEq, Show)]
7+
#[derive(Clone, PartialEq, Debug)]
88
pub struct AcceptEncoding(pub Vec<QualityItem<Encoding>>);
99

1010
impl_list_header!(AcceptEncoding,

src/header/common/allow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use header::parsing::{from_comma_delimited, fmt_comma_delimited};
66
/// The `Allow` header.
77
/// See also https://tools.ietf.org/html/rfc7231#section-7.4.1
88
9-
#[derive(Clone, PartialEq, Show)]
9+
#[derive(Clone, PartialEq, Debug)]
1010
pub struct Allow(pub Vec<Method>);
1111

1212
deref!(Allow => Vec<Method>);

src/header/common/authorization.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use serialize::base64::{ToBase64, FromBase64, Standard, Config, Newline};
55
use header::{Header, HeaderFormat};
66

77
/// The `Authorization` header field.
8-
#[derive(Clone, PartialEq, Show)]
8+
#[derive(Clone, PartialEq, Debug)]
99
pub struct Authorization<S: Scheme>(pub S);
1010

1111
impl<S: Scheme> Deref for Authorization<S> {
@@ -75,7 +75,7 @@ impl Scheme for String {
7575
}
7676

7777
/// Credential holder for Basic Authentication
78-
#[derive(Clone, PartialEq, Show)]
78+
#[derive(Clone, PartialEq, Debug)]
7979
pub struct Basic {
8080
/// The username as a possibly empty string
8181
pub username: String,
@@ -90,7 +90,7 @@ impl Scheme for Basic {
9090
}
9191

9292
fn fmt_scheme(&self, f: &mut fmt::Formatter) -> fmt::Result {
93-
//FIXME: serialize::base64 could use some Show implementation, so
93+
//FIXME: serialize::base64 could use some Debug implementation, so
9494
//that we don't have to allocate a new string here just to write it
9595
//to the formatter.
9696
let mut text = self.username.clone();

src/header/common/cache_control.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use header::{Header, HeaderFormat};
44
use header::parsing::{from_one_comma_delimited, fmt_comma_delimited};
55

66
/// The Cache-Control header.
7-
#[derive(PartialEq, Clone, Show)]
7+
#[derive(PartialEq, Clone, Debug)]
88
pub struct CacheControl(pub Vec<CacheDirective>);
99

1010
deref!(CacheControl => Vec<CacheDirective>);
@@ -34,7 +34,7 @@ impl HeaderFormat for CacheControl {
3434
}
3535

3636
/// CacheControl contains a list of these directives.
37-
#[derive(PartialEq, Clone, Show)]
37+
#[derive(PartialEq, Clone, Debug)]
3838
pub enum CacheDirective {
3939
/// "no-cache"
4040
NoCache,
@@ -69,10 +69,10 @@ pub enum CacheDirective {
6969
Extension(String, Option<String>)
7070
}
7171

72-
impl fmt::String for CacheDirective {
72+
impl fmt::Display for CacheDirective {
7373
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
7474
use self::CacheDirective::*;
75-
fmt::String::fmt(match *self {
75+
fmt::Display::fmt(match *self {
7676
NoCache => "no-cache",
7777
NoStore => "no-store",
7878
NoTransform => "no-transform",

src/header/common/connection.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ use header::parsing::{from_comma_delimited, fmt_comma_delimited};
66
pub use self::ConnectionOption::{KeepAlive, Close, ConnectionHeader};
77

88
/// The `Connection` header.
9-
#[derive(Clone, PartialEq, Show)]
9+
#[derive(Clone, PartialEq, Debug)]
1010
pub struct Connection(pub Vec<ConnectionOption>);
1111

1212
deref!(Connection => Vec<ConnectionOption>);
1313

1414
/// Values that can be in the `Connection` header.
15-
#[derive(Clone, PartialEq, Show)]
15+
#[derive(Clone, PartialEq, Debug)]
1616
pub enum ConnectionOption {
1717
/// The `keep-alive` connection value.
1818
KeepAlive,
@@ -39,7 +39,7 @@ impl FromStr for ConnectionOption {
3939
}
4040
}
4141

42-
impl fmt::String for ConnectionOption {
42+
impl fmt::Display for ConnectionOption {
4343
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
4444
write!(fmt, "{}", match *self {
4545
KeepAlive => "keep-alive",

src/header/common/content_length.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use header::parsing::from_one_raw_str;
66
/// The `Content-Length` header.
77
///
88
/// Simply a wrapper around a `usize`.
9-
#[derive(Copy, Clone, PartialEq, Show)]
9+
#[derive(Copy, Clone, PartialEq, Debug)]
1010
pub struct ContentLength(pub u64);
1111

1212
deref!(ContentLength => u64);
@@ -23,7 +23,7 @@ impl Header for ContentLength {
2323

2424
impl HeaderFormat for ContentLength {
2525
fn fmt_header(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
26-
fmt::String::fmt(&self.0, fmt)
26+
fmt::Display::fmt(&self.0, fmt)
2727
}
2828
}
2929

src/header/common/content_type.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use mime::Mime;
77
///
88
/// Used to describe the MIME type of message body. Can be used with both
99
/// requests and responses.
10-
#[derive(Clone, PartialEq, Show)]
10+
#[derive(Clone, PartialEq, Debug)]
1111
pub struct ContentType(pub Mime);
1212

1313
deref!(ContentType => Mime);
@@ -24,7 +24,7 @@ impl Header for ContentType {
2424

2525
impl HeaderFormat for ContentType {
2626
fn fmt_header(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
27-
fmt::String::fmt(&self.0, fmt)
27+
fmt::Display::fmt(&self.0, fmt)
2828
}
2929
}
3030

0 commit comments

Comments
 (0)