Make sure Notification cannot outlive Context
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
extern crate libnotify;
|
||||
|
||||
fn main() {
|
||||
let n = {
|
||||
let notify = libnotify::Context::new("hello").unwrap();
|
||||
notify.new_notification("Hello, ", "World!").unwrap()
|
||||
};
|
||||
let notify = libnotify::Context::new("hello").unwrap();
|
||||
let n = notify.new_notification("Hello, ", "World!").unwrap();
|
||||
n.show().unwrap();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user