diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2022-02-07 14:08:36 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-07 14:08:36 +0000 |
| commit | bd245facd40f455394d5bd8ee6a1972717f46f79 (patch) | |
| tree | c55499183b0324716879556f72891e3fba87a91c /compiler/rustc_target/src | |
| parent | 0b6c7fbbba8540cf33a257022324849580316510 (diff) | |
| parent | 0fb2b7a2da00fb323f43f2e503b79086135b5906 (diff) | |
| download | rust-bd245facd40f455394d5bd8ee6a1972717f46f79.tar.gz rust-bd245facd40f455394d5bd8ee6a1972717f46f79.zip | |
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.
Diffstat (limited to 'compiler/rustc_target/src')
| -rw-r--r-- | compiler/rustc_target/src/spec/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs index 92ee3fd294b..c96c52752d0 100644 --- a/compiler/rustc_target/src/spec/mod.rs +++ b/compiler/rustc_target/src/spec/mod.rs @@ -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) } |
