From 925504f230db683f2728f72577c3c7f2504b6f16 Mon Sep 17 00:00:00 2001 From: Milan Date: Thu, 15 Dec 2022 12:51:21 -0500 Subject: [PATCH] Fix doctest issue --- aya/src/programs/cgroup_device.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/aya/src/programs/cgroup_device.rs b/aya/src/programs/cgroup_device.rs index 3bff0ec5..be52a26e 100644 --- a/aya/src/programs/cgroup_device.rs +++ b/aya/src/programs/cgroup_device.rs @@ -23,12 +23,25 @@ use crate::{ /// # Examples /// /// ```no_run +/// # #[derive(Debug, thiserror::Error)] +/// # enum Error { +/// # #[error(transparent)] +/// # IO(#[from] std::io::Error), +/// # #[error(transparent)] +/// # Map(#[from] aya::maps::MapError), +/// # #[error(transparent)] +/// # Program(#[from] aya::programs::ProgramError), +/// # #[error(transparent)] +/// # Bpf(#[from] aya::BpfError) +/// # } +/// # let mut bpf = aya::Bpf::load(&[])?; /// use aya::programs::CgroupDevice; /// /// let cgroup = std::fs::File::open("/sys/fs/cgroup/unified")?; /// let program: &mut CgroupDevice = bpf.program_mut("cgroup_dev").unwrap().try_into()?; /// program.load()?; /// program.attach(cgroup)?; +/// # Ok::<(), Error>(()) /// ``` #[derive(Debug)] #[doc(alias = "BPF_PROG_TYPE_CGROUP_DEVICE")]