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