From 8e88f16912e8ec02457fcd01f2e2b801f5007f70 Mon Sep 17 00:00:00 2001 From: szymon Date: Sun, 4 Oct 2026 14:43:51 +0200 Subject: [PATCH] docs: add doctest to notification::new --- src/api/notification.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/api/notification.rs b/src/api/notification.rs index a1e6831..87d747e 100644 --- a/src/api/notification.rs +++ b/src/api/notification.rs @@ -66,6 +66,23 @@ impl<'a> Notification { /// /// # Errors /// This function can return LibnotifyError::{NewNotificationError, NulError} + /// + /// # Example + /// ``` + /// + /// use libnotify_rs::api::{ + /// functions::{init, uninit}, + /// notification::Notification, + /// }; + /// + /// fn main() -> Result<(), Box> { + /// init("Test app")?; + /// let notification = Notification::new("My notification", "Yap yap", None)?; + /// // ... + /// uninit(); + /// Ok(()) + /// } + /// ``` pub fn new(summary: &str, body: T, icon: Y) -> Result where T: Into>,