Skip to content

Commit

Permalink
build-manifest: use BufReader
Browse files Browse the repository at this point in the history
  • Loading branch information
pietroalbini committed Oct 1, 2020
1 parent fde1135 commit 9352062
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tools/build-manifest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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()))
Expand Down

0 comments on commit 9352062

Please sign in to comment.