File tree 2 files changed +3
-8
lines changed 2 files changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -164,10 +164,7 @@ pub struct StreamSelfEncryptor {
164
164
impl StreamSelfEncryptor {
165
165
/// For encryption, return with an intialized streaming encryptor.
166
166
/// If a `chunk_dir` is provided, the encrypted_chunks will be written into the specified dir as well.
167
- pub fn encrypt_from_file (
168
- file_path : PathBuf ,
169
- chunk_dir : Option < PathBuf > ,
170
- ) -> Result < Self > {
167
+ pub fn encrypt_from_file ( file_path : PathBuf , chunk_dir : Option < PathBuf > ) -> Result < Self > {
171
168
let file = File :: open ( & * file_path) ?;
172
169
let metadata = file. metadata ( ) ?;
173
170
let file_size = metadata. len ( ) ;
Original file line number Diff line number Diff line change @@ -34,10 +34,8 @@ fn test_stream_self_encryptor() -> Result<(), Error> {
34
34
create_dir_all ( chunk_path. clone ( ) ) ?;
35
35
36
36
// Encrypt the file using StreamSelfEncryptor
37
- let mut encryptor = StreamSelfEncryptor :: encrypt_from_file (
38
- file_path,
39
- Some ( chunk_path. clone ( ) ) ,
40
- ) ?;
37
+ let mut encryptor =
38
+ StreamSelfEncryptor :: encrypt_from_file ( file_path, Some ( chunk_path. clone ( ) ) ) ?;
41
39
let mut encrypted_chunks = Vec :: new ( ) ;
42
40
let mut data_map = None ;
43
41
while let Ok ( ( chunk, map) ) = encryptor. next_encryption ( ) {
You can’t perform that action at this time.
0 commit comments