From 892948638717c2ddb773afd7a03ab5444fb46353 Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Tue, 12 Jul 2022 14:45:45 +0100 Subject: [PATCH] Make doctest in interrupt.rs work --- agb/src/interrupt.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/agb/src/interrupt.rs b/agb/src/interrupt.rs index 3d08d21..c88fb9f 100644 --- a/agb/src/interrupt.rs +++ b/agb/src/interrupt.rs @@ -235,10 +235,17 @@ fn interrupt_to_root(interrupt: Interrupt) -> &'static InterruptRoot { /// /// # Examples /// -/// ``` -/// let _a = add_interrupt_handler(Interrupt::VBlank, |_: &CriticalSection| { -/// println!("Woah there! There's been a vblank!"); +/// ```rust,no_run +/// # #![no_std] +/// # #![no_main] +/// use bare_metal::CriticalSection; +/// +/// # fn foo() { +/// # use agb::interrupt::{add_interrupt_handler, Interrupt}; +/// let _a = add_interrupt_handler(Interrupt::VBlank, |_: CriticalSection| { +/// agb::println!("Woah there! There's been a vblank!"); /// }); +/// # } /// ``` pub fn add_interrupt_handler<'a>( interrupt: Interrupt,