docs: add doctest to is_inited

This commit is contained in:
2026-10-04 14:22:26 +02:00
parent 5c71686b17
commit be5d8e098c

View File

@@ -74,6 +74,20 @@ pub fn uninit() {
} }
/// Gets whether or not libnotify is initialized. /// Gets whether or not libnotify is initialized.
///
/// # Example
/// ```
/// use libnotify_rs::api::functions::{init, is_initted};
///
/// fn main() -> Result<(), Box<dyn std::error::Error>> {
/// if !is_initted() { // useful for conditional initing
/// init("Test app")?;
/// }
///
/// Ok(())
/// }
///
/// ```
pub fn is_initted() -> bool { pub fn is_initted() -> bool {
unsafe { notify_is_initted() != 0 } unsafe { notify_is_initted() != 0 }
} }