Skip to content

Commit

Permalink
Merge pull request #376 from hyperium/rustup
Browse files Browse the repository at this point in the history
fix(rustup): update to latest rustc
  • Loading branch information
seanmonstar committed Mar 16, 2015
2 parents db8654a + 4fd8a6a commit fe8c6d9
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 8 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ cookie = "*"
httparse = "*"
log = ">= 0.2.0"
mime = "*"
num_cpus = "*"
openssl = "*"
rustc-serialize = "*"
time = "*"
Expand Down
1 change: 1 addition & 0 deletions benches/client.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![deny(warnings)]
#![feature(collections, io, net, test)]
extern crate hyper;

Expand Down
3 changes: 2 additions & 1 deletion benches/server.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![feature(io, net, test)]
#![deny(warnings)]
#![feature(net, test)]
extern crate hyper;
extern crate test;

Expand Down
5 changes: 3 additions & 2 deletions examples/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ extern crate hyper;
extern crate env_logger;

use std::env;
use std::io;

use hyper::Client;

Expand All @@ -20,12 +21,12 @@ fn main() {

let mut client = Client::new();

let res = match client.get(&*url).send() {
let mut res = match client.get(&*url).send() {
Ok(res) => res,
Err(err) => panic!("Failed to connect: {:?}", err)
};

println!("Response: {}", res.status);
println!("Headers:\n{}", res.headers);
//TODO: add copy back when std::stdio impls std::io::Write.
io::copy(&mut res, &mut io::stdout()).unwrap();
}
2 changes: 1 addition & 1 deletion examples/hello.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![deny(warnings)]
#![feature(io, net)]
#![feature(net)]
extern crate hyper;
extern crate env_logger;

Expand Down
2 changes: 1 addition & 1 deletion examples/server.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![deny(warnings)]
#![feature(io, net)]
#![feature(net)]
extern crate hyper;
extern crate env_logger;

Expand Down
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(core, collections, io, net, os, path,
#![feature(core, collections, io, net,
std_misc, box_syntax, unsafe_destructor)]
#![deny(missing_docs)]
#![cfg_attr(test, deny(warnings))]
Expand Down Expand Up @@ -133,6 +133,7 @@ extern crate openssl;
extern crate cookie;
extern crate unicase;
extern crate httparse;
extern crate num_cpus;

#[macro_use]
extern crate log;
Expand Down
5 changes: 3 additions & 2 deletions src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
use std::io::{BufReader, BufWriter};
use std::marker::PhantomData;
use std::net::{IpAddr, SocketAddr};
use std::os;
use std::path::Path;
use std::thread::{self, JoinGuard};

use num_cpus;

pub use self::request::Request;
pub use self::response::Response;

Expand Down Expand Up @@ -83,7 +84,7 @@ impl<'a, H: Handler + 'static> Server<'a, H, HttpListener> {

/// Binds to a socket and starts handling connections.
pub fn listen(self, ip: IpAddr, port: u16) -> HttpResult<Listening> {
self.listen_threads(ip, port, os::num_cpus() * 5 / 4)
self.listen_threads(ip, port, num_cpus::get() * 5 / 4)
}
}
impl<
Expand Down

0 comments on commit fe8c6d9

Please sign in to comment.