From 8172a5f9fbc4228aa7e4dbf431499e110fc707df Mon Sep 17 00:00:00 2001 From: szymon Date: Sun, 4 Oct 2026 15:01:33 +0200 Subject: [PATCH] docs: add doctest to notification::show --- src/api/notification.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/api/notification.rs b/src/api/notification.rs index 293f7dc..b0f94ce 100644 --- a/src/api/notification.rs +++ b/src/api/notification.rs @@ -419,6 +419,27 @@ impl<'a> Notification { /// /// # Errors /// This function can return LibnotifyError::{GerrorError, AllocationError} + /// + /// # Example + /// ```no_run(No notification daemon on CI) + /// use libnotify_rs::api::{ + /// functions::{init, uninit}, + /// notification::{self, Notification}, + /// }; + /// + /// fn main() -> Result<(), Box> { + /// init("I love coffee")?; + /// let mut notify = Notification::new( + /// "Remember to drink coffe!", + /// "Coffee is very important for your mental health!", + /// None, + /// )?; + /// + /// notify.show()?; + /// + /// Ok(()) + /// } + /// ``` pub fn show(&self) -> Result<(), LibnotifyError> { let mut gerror = std::ptr::null_mut() as *mut GError;