rust-si
rust-si copied to clipboard
Issue with read! & serde_json::Result
I'm running into an issue when using serde_json's Result in the same program as text_io's read!() macro.
Here's an example:
#[macro_use] extern crate text_io;
use std::io;
use std::io::Write;
use serde::{Serialize, Deserialize};
use serde_json::{ Result, Value};
fn main() {
print!("Enter name: ");
std::io::stdout().flush().unwrap();
let name :String = read!();
println!("NAME: {}", name);
}
The compiler error is:
|
14 | let name :String = read!();
| ^^^^^^^ the trait `std::convert::From<text_io::Error>` is not implemented for `serde_json::error::Error`