| 1 | #![no_std] |
| 2 | |
| 3 | use ringbuf::StaticRb; |
| 4 | |
| 5 | fn main() { |
| 6 | const RB_SIZE: usize = 1; |
| 7 | let mut rb = StaticRb::<i32, RB_SIZE>::default(); |
| 8 | let (mut prod, mut cons) = rb.split_ref(); |
| 9 | |
| 10 | assert_eq!(prod.push(123), Ok(())); |
| 11 | assert_eq!(prod.push(321), Err(321)); |
| 12 | |
| 13 | assert_eq!(cons.pop(), Some(123)); |
| 14 | assert_eq!(cons.pop(), None); |
| 15 | } |