Przeglądaj źródła

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>
Dave Tucker 1 rok temu
rodzic
commit
e9e2f48d4f
1 zmienionych plików z 5 dodań i 5 usunięć
  1. 5 5
      aya/src/maps/ring_buf.rs

+ 5 - 5
aya/src/maps/ring_buf.rs

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