aya: Fix ringbuf docs

doctests are not running in CI and therefore the didn't catch the
ringbuf docs failures. This commit fixes the issues in the examples.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
pull/858/head
Dave Tucker 11 months ago
parent ec51881403
commit e9e2f48d4f

@ -68,15 +68,15 @@ use crate::{
/// # } /// # }
/// # fn clear_ready(&mut self) {} /// # fn clear_ready(&mut self) {}
/// # } /// # }
/// # let bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Bpf::load(&[])?;
/// use aya::maps::RingBuf; /// use aya::maps::RingBuf;
/// use std::convert::TryFrom; /// use std::convert::TryFrom;
/// ///
/// let ring_buf = RingBuf::try_from(bpf.map_mut("ARRAY")?)?; /// let ring_buf = RingBuf::try_from(bpf.map_mut("ARRAY").unwrap()).unwrap();
/// let poll = poll_fd(ring_buf); /// let mut poll = poll_fd(ring_buf);
/// loop { /// loop {
/// let mut guard = poll.readable()?; /// let mut guard = poll.readable();
/// let ring_buf = guard.inner_mut() /// let ring_buf = guard.inner_mut();
/// while let Some(item) = ring_buf.next() { /// while let Some(item) = ring_buf.next() {
/// println!("Received: {:?}", item); /// println!("Received: {:?}", item);
/// } /// }

Loading…
Cancel
Save