mirror of
https://github.com/szymon-jozef/libnotify-rs.git
synced 2026-10-27 11:10:47 +01:00
docs: add example to uninit
This commit is contained in:
@@ -54,6 +54,19 @@ where
|
||||
/// Uninitializes libnotify.
|
||||
///
|
||||
/// This should be called when the program no longer needs libnotify for the rest of its lifecycle, typically just before exitting.
|
||||
///
|
||||
/// # Example
|
||||
/// ```
|
||||
/// use libnotify_rs::api::functions::{init, uninit};
|
||||
///
|
||||
/// fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
/// init("Test app")?;
|
||||
/// // let notify = ...
|
||||
/// uninit(); // __always__ uninit libnotify after use
|
||||
/// Ok(())
|
||||
/// }
|
||||
///
|
||||
/// ```
|
||||
pub fn uninit() {
|
||||
unsafe {
|
||||
notify_uninit();
|
||||
|
||||
Reference in New Issue
Block a user