From 6ecf7dabf35f22869a95a8cd176b6f217ee57b05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alessandro=C2=A0Decina?= Date: Thu, 10 Jun 2021 09:05:17 +0000 Subject: [PATCH] aya: tweak PerfEventArray docs --- aya/src/maps/hash_map/hash_map.rs | 6 +++--- aya/src/maps/perf/perf_event_array.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/aya/src/maps/hash_map/hash_map.rs b/aya/src/maps/hash_map/hash_map.rs index 865f1e34..47e4e897 100644 --- a/aya/src/maps/hash_map/hash_map.rs +++ b/aya/src/maps/hash_map/hash_map.rs @@ -22,10 +22,10 @@ use crate::{ /// use aya::maps::HashMap; /// use std::convert::TryFrom; /// -/// const CONFIG_KEY_NUM_RETRIES: u8 = 1; +/// let mut redirect_ports = HashMap::try_from(bpf.map_mut("REDIRECT_PORTS")?)?; /// -/// let mut hm = HashMap::try_from(bpf.map_mut("CONFIG")?)?; -/// hm.insert(CONFIG_KEY_NUM_RETRIES, 3, 0 /* flags */); +/// redirect_ports.insert(80, 8080, 0 /* flags */); +/// redirect_ports.insert(443, 8443, 0 /* flags */); /// # Ok::<(), aya::BpfError>(()) /// ``` #[doc(alias = "BPF_MAP_TYPE_HASH")] diff --git a/aya/src/maps/perf/perf_event_array.rs b/aya/src/maps/perf/perf_event_array.rs index bd16102d..5107be19 100644 --- a/aya/src/maps/perf/perf_event_array.rs +++ b/aya/src/maps/perf/perf_event_array.rs @@ -137,7 +137,7 @@ impl> AsRawFd for PerfEventArrayBuffer { /// /// # Polling and avoiding lost events /// -/// In the example above the implementation of `poll_buffers` and `poll.poll_readable()` is not +/// In the example above the implementation of `poll_buffers()` and `poll.poll_readable()` is not /// given. [`PerfEventArrayBuffer`] implements the [`AsRawFd`] trait, so you can implement polling /// using any crate that can poll file descriptors, like [epoll], [mio] etc. ///