serde-rs / json

Strongly typed JSON library for Rust
Apache License 2.0
4.7k stars 536 forks source link

how to make serde_json take ascii text from a json file #1116

Closed moooichido closed 4 months ago

moooichido commented 4 months ago

how to make serde_json take ascii text from a json file and output it to the terminal, only when I tried to make it take a file from a folder, I got an error that the file could not be found, although everything was perfect, help with this question, or a code example of how this can be implemented in place of this:

image

moooichido commented 4 months ago

But when I try to do something like this, my program just crashes when I try to output this function in another function

image

moooichido commented 4 months ago

I rewrote the code to this form, and it does not crash the program, but there is one thing, but, as I said, the program cannot find the path to the file, although it exists, and that’s the essence of the question, how to fix this?

image

It produces the following error, Error: The system cannot find the specified path. (os error 3)

image