Drop json::from_reader
Performing UTF-8 decode outside the JSON module makes more sense in almost all cases.
This commit is contained in:
parent
cb18e83e85
commit
0fb2b7a2da
2 changed files with 2 additions and 24 deletions
|
@ -2145,8 +2145,8 @@ impl Target {
|
|||
use std::fs;
|
||||
|
||||
fn load_file(path: &Path) -> Result<(Target, TargetWarnings), String> {
|
||||
let contents = fs::read(path).map_err(|e| e.to_string())?;
|
||||
let obj = json::from_reader(&mut &contents[..]).map_err(|e| e.to_string())?;
|
||||
let contents = fs::read_to_string(path).map_err(|e| e.to_string())?;
|
||||
let obj = json::from_str(&contents).map_err(|e| e.to_string())?;
|
||||
Target::from_json(obj)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue