rust/src/test/run-pass/issue-3609.rs
Alex Crichton daf5f5a4d1 Drop the '2' suffix from logging macros
Who doesn't like a massive renaming?
2013-10-22 08:09:56 -07:00

29 lines
591 B
Rust

extern mod extra;
use std::comm::Chan;
use std::task;
type RingBuffer = ~[f64];
type SamplesFn = ~fn(samples: &RingBuffer);
enum Msg
{
GetSamples(~str, SamplesFn), // sample set name, callback which receives samples
}
fn foo(name: ~str, samples_chan: Chan<Msg>) {
do task::spawn
{
let callback: SamplesFn =
|buffer|
{
for i in range(0u, buffer.len()) {
error!("{}: {}", i, buffer[i])
}
};
samples_chan.send(GetSamples(name.clone(), callback));
};
}
pub fn main() {}