diff --git a/src/lib.rs b/src/lib.rs index 95d8b11a..46ceffea 100644 --- a/src/lib.rs +++ b/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"); //! } //! ```