mirror of
https://github.com/tribufu/unwrap-gui
synced 2025-06-15 18:54:19 +00:00
Create basic library
This commit is contained in:
9
examples/option.rs
Normal file
9
examples/option.rs
Normal file
@ -0,0 +1,9 @@
|
||||
// Copyright (c) Tribufu. All Rights Reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
use unwrap_gui::*;
|
||||
|
||||
fn main() {
|
||||
let option: Option<()> = None;
|
||||
option.unwrap_gui();
|
||||
}
|
13
examples/result.rs
Normal file
13
examples/result.rs
Normal file
@ -0,0 +1,13 @@
|
||||
// Copyright (c) Tribufu. All Rights Reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
use anyhow::{Error, Result};
|
||||
use unwrap_gui::*;
|
||||
|
||||
fn main() {
|
||||
let result: Result<()> = Err(Error::msg(
|
||||
"With this trait you can display a message and exit the app.",
|
||||
));
|
||||
|
||||
result.unwrap_gui();
|
||||
}
|
Reference in New Issue
Block a user