Rollup merge of #93680 - Mark-Simulacrum:drop-json-reader, r=bjorn3
Drop json::from_reader Just a small cleanup -- this was essentially unused; the one use site is better suited to reading from &str regardless.
This commit is contained in:
commit
bd245facd4
2 changed files with 2 additions and 24 deletions
|
@ -2148,8 +2148,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