ringbuf-basedrop 0.1.1

A fork of the `ringbuf` crate that uses basedrop's Shared pointer in place of Arc
Documentation
extern crate ringbuf_basedrop;

use basedrop::Collector;
use ringbuf_basedrop::RingBuffer;

fn main() {
    let collector = Collector::new();

    let rb = RingBuffer::<i32>::new(2);
    let (mut prod, mut cons) = rb.split(&collector.handle());

    prod.push(0).unwrap();
    prod.push(1).unwrap();
    assert_eq!(prod.push(2), Err(2));

    assert_eq!(cons.pop().unwrap(), 0);

    prod.push(2).unwrap();

    assert_eq!(cons.pop().unwrap(), 1);
    assert_eq!(cons.pop().unwrap(), 2);
    assert_eq!(cons.pop(), None);
}