Using Json library

Hello
I am trying to call a TK source for (de)generate a form, an this is working.
My problem is after, for I would read a Json form's outupt and create a Rust variables.
The installation of serd_json finish in error:
`C:\Users\User.cargo>cargo install serde_json
Updating crates.io index
Installing serde_json v1.0.45
error: specified package has no binaries

C:\Users\User.cargo>And the compilation ofextern crate serde_json;
use serde_json::{Result, Value};
...Shows:error[E0463]: can't find crate for serde_json
--> rust\TclTk.rs:9:1
|
9 | extern crate serde_json;
| ^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
`
Thanks

Please use code blocks

```text
contents go here
```

Here text is an optional tag for syntax highlighting (the default is Rust).

You need to add serde_json to your Cargo.toml instead of using cargo install.

[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }

The second dependency is for #[derive(Serialize)] and #[derive(Deserialize)] support, but is not necessary otherwise.

The cargo install command is for installing command line tools, not for adding libraries to your projects.

I apologize (I have not see a preview button).
Thank for your second answer

[quote="rossati, post:1, topic:37518"]
Hello
I am trying to call a TK source for (de)generate a form, an this is working.
My problem is after, for I would read a Json form's outupt and create a Rust variables.
The installation of serd_json finish in error:

`C:\Users\User.cargo>cargo install serde_json
Updating [crates.io](http://crates.io) index
Installing serde_json v1.0.45
error: specified package has no binaries

C:\Users\User.cargo> 

And the compilation of

 extern crate serde_json;
use serde_json::{Result, Value};
...

Shows:error[E0463]: ```textcan't find crate forserde_json`
--> rust\TclTk.rs:9:1
|
9 | extern crate serde_json;
| ^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate

Thanks

There should definitely be a preview available. Are you using a small screen or a phone? Note also that you can edit posts.

THanks Alice
I found a preview in my laptop.

The preview is this button here:


And the three dashes to the right of the topic name at the top of the box allow you to use all of the formatting shortcuts if you don't already know how to type them out by hand.

Thanks OptimisticPeach
In my PC screen is at right of the input text and I discovered it when I clicked a button captioned "ESC"

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.