Skip to content

Commit

Permalink
style: cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
b-zee committed Jul 26, 2024
1 parent 82dc789 commit e9866f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
5 changes: 1 addition & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,7 @@ pub struct StreamSelfEncryptor {
impl StreamSelfEncryptor {
/// For encryption, return with an intialized streaming encryptor.
/// If a `chunk_dir` is provided, the encrypted_chunks will be written into the specified dir as well.
pub fn encrypt_from_file(
file_path: PathBuf,
chunk_dir: Option<PathBuf>,
) -> Result<Self> {
pub fn encrypt_from_file(file_path: PathBuf, chunk_dir: Option<PathBuf>) -> Result<Self> {
let file = File::open(&*file_path)?;
let metadata = file.metadata()?;
let file_size = metadata.len();
Expand Down
6 changes: 2 additions & 4 deletions src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@ fn test_stream_self_encryptor() -> Result<(), Error> {
create_dir_all(chunk_path.clone())?;

// Encrypt the file using StreamSelfEncryptor
let mut encryptor = StreamSelfEncryptor::encrypt_from_file(
file_path,
Some(chunk_path.clone()),
)?;
let mut encryptor =
StreamSelfEncryptor::encrypt_from_file(file_path, Some(chunk_path.clone()))?;
let mut encrypted_chunks = Vec::new();
let mut data_map = None;
while let Ok((chunk, map)) = encryptor.next_encryption() {
Expand Down

0 comments on commit e9866f6

Please sign in to comment.