Update doc example

This commit is contained in:
Mika Attila 2015-03-10 19:18:44 +01:00
parent 445f0b6d13
commit d3ad5323fb
1 changed files with 10 additions and 5 deletions

View File

@ -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");
//! }
//! ```