Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Rust update: Unboxed closures and removal of proc() #188

Merged
merged 2 commits into from
Dec 15, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion codegen/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub mod status;
pub mod read_method;

fn main() {
spawn(proc() {
spawn(move || {
let output_dir = Path::new(os::getenv("OUT_DIR").unwrap());
read_method::generate(output_dir).unwrap();
});
Expand Down
6 changes: 4 additions & 2 deletions src/http/headers/serialization_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ pub fn comma_split(value: &str) -> Vec<String> {
}

pub fn comma_split_iter<'a>(value: &'a str)
-> ::std::iter::Map<'a, &'a str, &'a str, ::std::str::CharSplits<'a, char>> {
value.split(',').map(|w| w.trim_left())
-> ::std::iter::Map<&'a str, &'a str, ::std::str::CharSplits<'a, char>, fn(&str) -> &str> {
fn trim(w: &str) -> &str {w.trim_left()}

value.split(',').map(trim)
}

pub trait WriterUtil: Writer {
Expand Down
4 changes: 2 additions & 2 deletions src/http/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub trait Server: Send + Clone {
};
debug!("listening");
let (perf_sender, perf_receiver) = channel();
spawn(proc() {
spawn(move || {
perf_dumper(perf_receiver);
});
loop {
Expand All @@ -54,7 +54,7 @@ pub trait Server: Send + Clone {
};
let child_perf_sender = perf_sender.clone();
let child_self = self.clone();
spawn(proc() {
spawn(move || {
let mut time_start = time_start;
let mut stream = BufferedStream::new(stream);
debug!("accepted connection");
Expand Down