docs: add doctest to notification::update

This commit is contained in:
2026-10-04 15:03:43 +02:00
parent 8172a5f9fb
commit fdbf332615

View File

@@ -472,6 +472,19 @@ impl<'a> Notification {
/// ///
/// # Errors /// # Errors
/// This function can return LibnotifyError::{NulError} /// This function can return LibnotifyError::{NulError}
///
/// # Example
/// ```
/// use libnotify_rs::api::{functions::init, notification::Notification};
///
/// fn main() -> Result<(), Box<dyn std::error::Error>> {
/// init("Test app")?;
/// let mut notification = Notification::new("My notification", "Yap yap", None)?;
/// notification.update("My new summary", "My new body", None)?;
///
/// Ok(())
/// }
/// ```
pub fn update<'b, F, I>( pub fn update<'b, F, I>(
&mut self, &mut self,
summary: &str, summary: &str,