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;
|
//! extern crate libnotify;
|
||||||
//!
|
//!
|
||||||
//! fn main() {
|
//! fn main() {
|
||||||
//! let notify = libnotify::Context::new("hello").unwrap();
|
//! let notify = libnotify::Context::new("hello").unwrap_or_else(|e| {
|
||||||
//! let n = notify.new_notification("This is the summary.",
|
//! panic!("{}", e);
|
||||||
//! Some("This is the optional body text."),
|
//! });
|
||||||
//! None).unwrap();
|
//! let body_text = Some("This is the optional body text.");
|
||||||
//! n.show().unwrap();
|
//! 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