Update doc example
This commit is contained in:
parent
445f0b6d13
commit
d3ad5323fb
15
src/lib.rs
15
src/lib.rs
@ -4,11 +4,16 @@
|
||||
//! extern crate libnotify;
|
||||
//!
|
||||
//! fn main() {
|
||||
//! let notify = libnotify::Context::new("hello").unwrap();
|
||||
//! let n = notify.new_notification("This is the summary.",
|
||||
//! Some("This is the optional body text."),
|
||||
//! None).unwrap();
|
||||
//! n.show().unwrap();
|
||||
//! let notify = libnotify::Context::new("hello").unwrap_or_else(|e| {
|
||||
//! panic!("{}", e);
|
||||
//! });
|
||||
//! let body_text = Some("This is the optional body text.");
|
||||
//! let n = notify.new_notification("This is the summary.",
|
||||
//! body_text,
|
||||
//! None).unwrap_or_else(|e| {
|
||||
//! panic!("{}", e);
|
||||
//! });
|
||||
//! n.show().ok().expect("Failed to show notification");
|
||||
//! }
|
||||
//! ```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user