Skip to content

Commit

Permalink
chore: use from string instead of from_anyhow anyhow! (#10282)
Browse files Browse the repository at this point in the history
* Use from string instead of from_anyhow anyhow!

* Clippy
  • Loading branch information
Legend-Master committed Jul 14, 2024
1 parent 3c17fb6 commit 506f1dd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/tauri/src/ipc/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ impl<'de, R: Runtime, TSend: Clone> CommandArg<'de, R> for Channel<TSend> {
JavaScriptChannelId::from_str(&value)
.map(|id| id.channel_on(webview))
.map_err(|_| {
InvokeError::from_anyhow(anyhow::anyhow!(
InvokeError::from(format!(
"invalid channel value `{value}`, expected a string in the `{IPC_PAYLOAD_PREFIX}ID` format"
))
})
Expand Down
4 changes: 1 addition & 3 deletions core/tauri/src/webview/webview_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -932,9 +932,7 @@ impl<'de, R: Runtime> CommandArg<'de, R> for WebviewWindow<R> {
if webview.window().is_webview_window() {
Ok(Self { webview })
} else {
Err(InvokeError::from_anyhow(anyhow::anyhow!(
"current webview is not a WebviewWindow"
)))
Err(InvokeError::from("current webview is not a WebviewWindow"))
}
}
}
Expand Down

0 comments on commit 506f1dd

Please sign in to comment.