about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorPietro Albini <pietro@pietroalbini.org>2020-10-01 19:42:02 +0200
committerPietro Albini <pietro@pietroalbini.org>2020-10-01 19:42:02 +0200
commit9352062bc3aa3c1b3cc635069a806915fcba5b1e (patch)
tree3c0b7fb9b6f9d1b418890aac2242db6ef84f6a18 /src
parentfde113591680c96459abdc4aae5d2b0dc21da87b (diff)
downloadrust-9352062bc3aa3c1b3cc635069a806915fcba5b1e.tar.gz
rust-9352062bc3aa3c1b3cc635069a806915fcba5b1e.zip
build-manifest: use BufReader
Diffstat (limited to 'src')
-rw-r--r--src/tools/build-manifest/src/main.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs
index 1a698bbac05..6524398f5ba 100644
--- a/src/tools/build-manifest/src/main.rs
+++ b/src/tools/build-manifest/src/main.rs
@@ -15,7 +15,7 @@ use std::collections::{BTreeMap, HashMap, HashSet};
 use std::env;
 use std::error::Error;
 use std::fs::{self, File};
-use std::io::{self, Read, Write};
+use std::io::{self, BufReader, Read, Write};
 use std::path::{Path, PathBuf};
 use std::process::{Command, Stdio};
 use std::sync::Mutex;
@@ -632,7 +632,7 @@ impl Builder {
 }
 
 fn fetch_hash(path: &Path) -> Result<String, Box<dyn Error>> {
-    let mut file = File::open(path)?;
+    let mut file = BufReader::new(File::open(path)?);
     let mut sha256 = sha2::Sha256::default();
     std::io::copy(&mut file, &mut sha256)?;
     Ok(hex::encode(sha256.finalize()))