Hi!
Thanks for the great writeup! Excited to dip further into the topic.
As i followed along your tutorial i encountered a problem in src-tauri/src/main.rs. Defining the hello function public throws compilation error[E0255], removing the pub declaration fixes it. I'm not a 100% sure why though.
error[E0255]: the name `__cmd__hello` is defined multiple times
--> src/main.rs:14:8
|
13 | #[tauri::command]
| ----------------- previous definition of the macro `__cmd__hello` here
14 | pub fn hello (name: &str) -> Result<String, String> {
| ^^^^^ `__cmd__hello` reimported here
|
= note: `__cmd__hello` must be defined only once in the macro namespace of this module
help: you can use `as` to change the binding name of the import
|
14 | pub fn hello as other___cmd__hello (name: &str) -> Result<String, String> {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~
For more information about this error, try `rustc --explain E0255`.
error: could not compile `app` due to previous error
Software Engineer and full-time Rustacean. While Rust is my primary language, I am also fluent in Python and Typescript. I'm also currently making a game with Godot using C#.
I've removed the pub. Hopefully that solves the issue if anyone else is following along. I just have encountered the same thing on my travels and removed it. I guess there's no need for it to be public. It could be a bug with the proc macro or maybe it's intentional. I'm not sure.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi!
Thanks for the great writeup! Excited to dip further into the topic.
As i followed along your tutorial i encountered a problem in
src-tauri/src/main.rs
. Defining thehello
function public throws compilation error[E0255], removing the pub declaration fixes it. I'm not a 100% sure why though.I've removed the
pub
. Hopefully that solves the issue if anyone else is following along. I just have encountered the same thing on my travels and removed it. I guess there's no need for it to be public. It could be a bug with the proc macro or maybe it's intentional. I'm not sure.