summaryrefslogtreecommitdiff
path: root/examples/send_before_recv.rs
blob: c31ba658d3a6625da01e36d13fa0b013cd981a1a (plain)
1
2
3
4
5
6
7
8
9
10
11
#[cfg(feature = "std")]
fn main() {
    let (sender, receiver) = oneshot::channel();
    assert!(sender.send(19i128).is_ok());
    assert_eq!(receiver.recv(), Ok(19i128));
}

#[cfg(not(feature = "std"))]
fn main() {
    panic!("This example is only for when the \"sync\" feature is used");
}