simplify error handling
This commit is contained in:
parent
e431dc89a8
commit
bd652c956f
8 changed files with 94 additions and 147 deletions
|
@ -10,7 +10,7 @@ pub async fn get_name() -> anyhow::Result<()> {
|
|||
}
|
||||
|
||||
pub async fn get_version() -> anyhow::Result<()> {
|
||||
let version = app::get_version().await;
|
||||
let version = app::get_version().await?;
|
||||
|
||||
ensure!(version.major == 0);
|
||||
ensure!(version.minor == 0);
|
||||
|
|
|
@ -4,7 +4,7 @@ use tauri_sys::clipboard;
|
|||
pub async fn test() -> anyhow::Result<()> {
|
||||
clipboard::write_text("foobar").await;
|
||||
|
||||
let text = clipboard::read_text().await;
|
||||
let text = clipboard::read_text().await?;
|
||||
|
||||
ensure!(text == Some("foobar".to_string()));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue