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

Commit bba4ef2

Browse files
committed
Merge pull request #188 from Ogeon/master
Rust update: Unboxed closures and removal of proc()
2 parents 47533b5 + e55bc7d commit bba4ef2

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

codegen/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pub mod status;
88
pub mod read_method;
99

1010
fn main() {
11-
spawn(proc() {
11+
spawn(move || {
1212
let output_dir = Path::new(os::getenv("OUT_DIR").unwrap());
1313
read_method::generate(output_dir).unwrap();
1414
});

src/http/headers/serialization_utils.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ pub fn comma_split(value: &str) -> Vec<String> {
5353
}
5454

5555
pub fn comma_split_iter<'a>(value: &'a str)
56-
-> ::std::iter::Map<'a, &'a str, &'a str, ::std::str::CharSplits<'a, char>> {
57-
value.split(',').map(|w| w.trim_left())
56+
-> ::std::iter::Map<&'a str, &'a str, ::std::str::CharSplits<'a, char>, fn(&str) -> &str> {
57+
fn trim(w: &str) -> &str {w.trim_left()}
58+
59+
value.split(',').map(trim)
5860
}
5961

6062
pub trait WriterUtil: Writer {

src/http/server/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub trait Server: Send + Clone {
3535
};
3636
debug!("listening");
3737
let (perf_sender, perf_receiver) = channel();
38-
spawn(proc() {
38+
spawn(move || {
3939
perf_dumper(perf_receiver);
4040
});
4141
loop {
@@ -54,7 +54,7 @@ pub trait Server: Send + Clone {
5454
};
5555
let child_perf_sender = perf_sender.clone();
5656
let child_self = self.clone();
57-
spawn(proc() {
57+
spawn(move || {
5858
let mut time_start = time_start;
5959
let mut stream = BufferedStream::new(stream);
6060
debug!("accepted connection");

0 commit comments

Comments
 (0)