Implement std::fmt::Display for the error types
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
extern crate libnotify;
|
||||
|
||||
fn main() {
|
||||
let notify = libnotify::Context::new("hello").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.",
|
||||
Some("This is the optional body text."),
|
||||
None).unwrap();
|
||||
n.show().unwrap();
|
||||
body_text,
|
||||
None).unwrap_or_else(|e| panic!("{}", e));
|
||||
n.show().ok().expect("Failed to show notification");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user