diff options
author | Neal H. Walfield <neal@pep.foundation> | 2020-01-18 13:24:38 +0100 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2020-01-18 13:24:38 +0100 |
commit | 6ade8430c79683ad252fbde6fa67108f214e6d0a (patch) | |
tree | 9b591edcfccfa5bd37eb95977094ff6c56f3648e /sqv | |
parent | 9d5598f1f529ce507fbf6e20ae55cab429806c95 (diff) |
sqv: Drop data more idiomatically.
Diffstat (limited to 'sqv')
-rw-r--r-- | sqv/src/sqv.rs | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/sqv/src/sqv.rs b/sqv/src/sqv.rs index 6ee3deae..fe97b246 100644 --- a/sqv/src/sqv.rs +++ b/sqv/src/sqv.rs @@ -4,7 +4,7 @@ /// the motivation. use std::process::exit; -use std::io::Read; +use std::io; use chrono::{DateTime, offset::Utc}; extern crate clap; @@ -273,14 +273,7 @@ fn real_main() -> Result<()> { let mut v = DetachedVerifier::from_file( sig_file, file, h, None)?; - let mut buffer = Vec::with_capacity(1024 * 1024); - loop { - match v.read(&mut buffer) { - Ok(0) => break, // EOF - Ok(_) => (), // There is more to read. - Err(err) => return Err(err.into()), - } - } + io::copy(&mut v, &mut io::sink())?; let h = v.into_helper(); |