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. ///