Apply suggestions from code review

Co-authored-by: Richard Feldman <oss@rtfeldman.com>
This commit is contained in:
Brendan Hansknecht 2021-09-11 22:44:39 -07:00 committed by GitHub
parent 1caa92b173
commit f6ca8048da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -129,7 +129,7 @@ pub fn preprocess(matches: &ArgMatches) -> io::Result<i32> {
let time = matches.is_present(FLAG_TIME); let time = matches.is_present(FLAG_TIME);
let total_start = SystemTime::now(); let total_start = SystemTime::now();
let exec_parsing_start = SystemTime::now(); let exec_parsing_start = total_start;
let exec_file = fs::File::open(&matches.value_of(EXEC).unwrap())?; let exec_file = fs::File::open(&matches.value_of(EXEC).unwrap())?;
let exec_mmap = unsafe { Mmap::map(&exec_file)? }; let exec_mmap = unsafe { Mmap::map(&exec_file)? };
let exec_data = &*exec_mmap; let exec_data = &*exec_mmap;
@ -911,7 +911,7 @@ pub fn surgery(matches: &ArgMatches) -> io::Result<i32> {
let time = matches.is_present(FLAG_TIME); let time = matches.is_present(FLAG_TIME);
let total_start = SystemTime::now(); let total_start = SystemTime::now();
let loading_metadata_start = SystemTime::now(); let loading_metadata_start = total_start;
let input = fs::File::open(&matches.value_of(METADATA).unwrap())?; let input = fs::File::open(&matches.value_of(METADATA).unwrap())?;
let input = BufReader::new(input); let input = BufReader::new(input);
let md: metadata::Metadata = match deserialize_from(input) { let md: metadata::Metadata = match deserialize_from(input) {