change read buff

This commit is contained in:
2019-11-23 19:29:37 +08:00
parent 9737ecce41
commit 96462d5d4a

View File

@@ -5,7 +5,6 @@ use rust_util::{
print_message, print_message,
MessageType, MessageType,
}, },
util_io::*,
}; };
use std::{ use std::{
fs::File, fs::File,
@@ -133,7 +132,7 @@ KECCAK-224, KECCAK-256, KECCAK-384, KECCAK-512, SM3
} }
fn read_file_full(file_name: &str) -> XResult<Vec<u8>> { fn read_file_full(file_name: &str) -> XResult<Vec<u8>> {
let mut buf: [u8; DEFAULT_BUF_SIZE] = [0u8; DEFAULT_BUF_SIZE]; let mut buf: [u8; BUFF_SIZE] = [0u8; BUFF_SIZE];
let mut f = File::open(file_name)?; let mut f = File::open(file_name)?;
let file_len = f.metadata()?.len(); let file_len = f.metadata()?.len();
let mut ret: Vec<u8> = Vec::new(); let mut ret: Vec<u8> = Vec::new();