#mismatch type error while reading json files
8 messages · Page 1 of 1 (latest)
i guess you'd want to remove the very last ; from the last line there (or add return in front if you prefer that syntax)
it dosen't help
I get another error:
error[E0308]: mismatched types
--> src\main.rs:40:5
|
32 | fn conf(handle: tauri::AppHandle) -> String {
| ------ expected std::string::String because of return type
...
40 | lang_de.get("test").unwrap()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^- help: try using a conversion method: .to_string()
| |
| expected String, found &Value
you could change the return value to Value instead of String (and then add .to_owned() at the end
instead of .unwrap()?
no, after that
hm
still dosn't solve the issue
error[E0412]: cannot find type Value in this scope
--> src\main.rs:32:38
|
32 | fn conf(handle: tauri::AppHandle) -> Value {
| ^^^^^ not found in this scope
|
help: consider importing this enum
|
3 + use serde_json::Value;
|
do what it says (or change the return value to serde_json::Value if you don't wanna import it)