Skip to content

Commit

Permalink
chore(travis): set minimum rust version
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar committed Apr 10, 2017
1 parent 030393d commit f05a58a
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 34 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -6,6 +6,7 @@ matrix:
env: FEATURES="--features nightly"
- rust: beta
- rust: stable
- rust: 1.10.0

cache:
apt: true
Expand Down
4 changes: 0 additions & 4 deletions Cargo.toml
Expand Up @@ -10,7 +10,6 @@ license = "MIT"
authors = ["Sean McArthur <sean.monstar@gmail.com>"]
keywords = ["http", "hyper", "hyperium"]
categories = ["web-programming::http-client", "web-programming::http-server"]
build = "build.rs"

include = [
"build.rs",
Expand Down Expand Up @@ -41,9 +40,6 @@ num_cpus = "1.0"
pretty_env_logger = "0.1"
spmc = "0.2"

[build-dependencies]
rustc_version = "0.1"

[features]
default = []
nightly = []
7 changes: 0 additions & 7 deletions build.rs

This file was deleted.

6 changes: 3 additions & 3 deletions src/header/common/accept_language.rs
Expand Up @@ -58,9 +58,9 @@ header! {
test_header!(
test2, vec![b"en-US, en; q=0.5, fr"],
Some(AcceptLanguage(vec![
qitem(langtag!(en;;;US)),
QualityItem::new(langtag!(en), Quality(500)),
qitem(langtag!(fr)),
qitem("en-US".parse().unwrap()),
QualityItem::new("en".parse().unwrap(), Quality(500)),
qitem("fr".parse().unwrap()),
])));
}
}
Expand Down
8 changes: 5 additions & 3 deletions src/header/common/host.rs
Expand Up @@ -24,7 +24,9 @@ use header::parsing::from_one_raw_str;
///
/// let mut headers = Headers::new();
/// headers.set(
/// Host::new("hyper.rs", 8080)
/// // In Rust 1.12+
/// // Host::new("hyper.rs", 8080)
/// Host::new("hyper.rs", Some(8080))
/// );
/// ```
#[derive(Clone, PartialEq, Debug)]
Expand Down Expand Up @@ -113,13 +115,13 @@ mod tests {


let host = Header::parse_header(&vec![b"foo.com:8080".to_vec()].into());
assert_eq!(host.ok(), Some(Host::new("foo.com", 8080)));
assert_eq!(host.ok(), Some(Host::new("foo.com", Some(8080))));

let host = Header::parse_header(&vec![b"foo.com".to_vec()].into());
assert_eq!(host.ok(), Some(Host::new("foo.com", None)));

let host = Header::parse_header(&vec![b"[::1]:8080".to_vec()].into());
assert_eq!(host.ok(), Some(Host::new("[::1]", 8080)));
assert_eq!(host.ok(), Some(Host::new("[::1]", Some(8080))));

let host = Header::parse_header(&vec![b"[::1]".to_vec()].into());
assert_eq!(host.ok(), Some(Host::new("[::1]", None)));
Expand Down
4 changes: 2 additions & 2 deletions src/header/common/link.rs
Expand Up @@ -982,7 +982,7 @@ mod tests {
.push_rel(RelationType::Previous)
.set_anchor("../anchor/example/")
.push_rev(RelationType::Next)
.push_href_lang(langtag!(de))
.push_href_lang("de".parse().unwrap())
.push_media_desc(MediaDesc::Screen)
.set_title("previous chapter")
.set_title_star("title* unparsed")
Expand Down Expand Up @@ -1042,7 +1042,7 @@ mod tests {
.push_rel(RelationType::Previous)
.set_anchor("/anchor/example/")
.push_rev(RelationType::Next)
.push_href_lang(langtag!(de))
.push_href_lang("de".parse().unwrap())
.push_media_desc(MediaDesc::Screen)
.set_title("previous chapter")
.set_title_star("title* unparsed")
Expand Down
3 changes: 2 additions & 1 deletion src/header/parsing.rs
Expand Up @@ -177,10 +177,11 @@ mod percent_encoding_http {
mod tests {
use header::shared::Charset;
use super::{ExtendedValue, parse_extended_value};
use language_tags::LanguageTag;

#[test]
fn test_parse_extended_value_with_encoding_and_language_tag() {
let expected_language_tag = langtag!(en);
let expected_language_tag = "en".parse::<LanguageTag>().unwrap();
// RFC 5987, Section 3.2.2
// Extended notation, using the Unicode character U+00A3 (POUND SIGN)
let result = parse_extended_value("iso-8859-1'en'%A3%20rates");
Expand Down
2 changes: 1 addition & 1 deletion src/http/h1/decode.rs
Expand Up @@ -458,7 +458,7 @@ mod tests {
let content_len = content.len();
for block_at in 0..content_len {
let actual = read_async(decoder.clone(), content.as_bytes(), block_at);
assert_eq!(expected, &actual, "Failed async. Blocking at {}", block_at);
assert_eq!(expected, &actual) //, "Failed async. Blocking at {}", block_at);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/http/mod.rs
Expand Up @@ -131,7 +131,7 @@ pub trait Http1Transaction {
fn should_set_length(head: &MessageHead<Self::Outgoing>) -> bool;
}

type ParseResult<T> = ::Result<Option<(MessageHead<T>, usize)>>;
pub type ParseResult<T> = ::Result<Option<(MessageHead<T>, usize)>>;

struct DebugTruncate<'a>(&'a [u8]);

Expand Down
9 changes: 1 addition & 8 deletions src/lib.rs
Expand Up @@ -18,7 +18,7 @@ extern crate bytes;
#[macro_use] extern crate futures;
extern crate futures_cpupool;
extern crate httparse;
#[cfg_attr(test, macro_use)] extern crate language_tags;
extern crate language_tags;
#[macro_use] extern crate log;
#[macro_use] pub extern crate mime;
extern crate base64;
Expand Down Expand Up @@ -56,13 +56,6 @@ macro_rules! unimplemented {
});
}

macro_rules! deprecated {
(#[$note:meta] $i:item) => (
#[cfg_attr(has_deprecated, $note)]
$i
);
}

#[cfg(test)]
mod mock;
pub mod client;
Expand Down
2 changes: 1 addition & 1 deletion src/uri.rs
Expand Up @@ -553,6 +553,6 @@ fn test_uri_to_origin_form() {

for case in cases {
let uri = Uri::from_str(case.0).unwrap();
assert_eq!(origin_form(&uri), case.1, "{:?}", case);
assert_eq!(origin_form(&uri), case.1); //, "{:?}", case);
}
}
6 changes: 3 additions & 3 deletions tests/client.rs
Expand Up @@ -78,7 +78,7 @@ macro_rules! test {
while n < buf.len() && n < expected.len() {
n += inc.read(&mut buf[n..]).unwrap();
}
assert_eq!(s(&buf[..n]), expected, "expected is invalid");
assert_eq!(s(&buf[..n]), expected);

inc.write_all($server_reply.as_ref()).unwrap();
let _ = tx.send(());
Expand All @@ -89,9 +89,9 @@ macro_rules! test {
let work = res.join(rx).map(|r| r.0);

let res = core.run(work).unwrap();
assert_eq!(res.status(), StatusCode::$client_status, "status is invalid");
assert_eq!(res.status(), StatusCode::$client_status);
$(
assert_eq!(res.headers().get(), Some(&$response_headers), "headers are invalid");
assert_eq!(res.headers().get(), Some(&$response_headers));
)*
}
);
Expand Down

0 comments on commit f05a58a

Please sign in to comment.