Replies: 3 comments 1 reply
-
Currently struggling with this myself! Would love to have the clean syntax from the implicit conversion. |
Beta Was this translation helpful? Give feedback.
-
Not an actual answer to the "why" since I wasn't involved in the linked change, but i always thought that you're not supposed to use So from that POV, not having |
Beta Was this translation helpful? Give feedback.
-
This is not by design, but a consequence of Rust's rules around implementing traits for types from 3rd party crates. If you look at the code You will notice we are implementing Now if we were to try to add another impl
You will notice the compiler complains. This is because This is why we have the rather verbose If you're familiar with Rust RFCs you might have noticed that this sounds and awful lot like specialization and indeed this would solve our issue, as the compiler would now accept our two |
Beta Was this translation helpful? Give feedback.
-
InvokeError
hasfrom_anyhow
, which converts an anyhow error to itself. It is useful, so that user can call an internal functions that returns anyhow error from acommand
function. However, it still requires an explicitmap_error(InvokeError::from)
at the end of every fallible command. Why did tauri decide to not implementFrom<anyhow::Error>
so that the conversion can be implicit?Beta Was this translation helpful? Give feedback.
All reactions