I am getting the following error when I use serde to read a json from a file:
Failed to resolve: use of undeclared crate or module serde_json
here's the code:
use serde::Deserialize;
fn main() {
let file = fs::File::open("./feed.json")
.expect("file should open read only");
let reader = BufReader::new(file);
let json = serde_json::from_reader(reader)
.expect("file should have FirstName key");
let feed_url = json.get("2.0")
.expect("file should have FirstName key");
println!("{}", reedFeed(feed_url));
}
Here's the doc on this function. I am on ubuntu and using intellij as my ide. What am I missing here?