fn delete_files(&mut self) {
        let start_time: SystemTime = SystemTime::now();
        if self.delete_method == DeleteMethod::None {
            return;
        }

        match self.check_method {
            CheckingMethod::Name => {
                for vector in self.files_with_identical_names.values() {
                    let tuple: (u64, usize, usize) = delete_files(vector, &self.delete_method, &mut self.text_messages, self.dryrun);
                    self.information.gained_space += tuple.0;
                    self.information.number_of_removed_files += tuple.1;
                    self.information.number_of_failed_to_remove_files += tuple.2;
                }
            }
            CheckingMethod::Hash | CheckingMethod::HashMb => {
                for vector_vectors in self.files_with_identical_hashes.values() {
                    for vector in vector_vectors.iter() {
                        let tuple: (u64, usize, usize) = delete_files(vector, &self.delete_method, &mut self.text_messages, self.dryrun);
                        self.information.gained_space += tuple.0;
                        self.information.number_of_removed_files += tuple.1;
                        self.information.number_of_failed_to_remove_files += tuple.2;
                    }
                }
            }
            CheckingMethod::Size => {
                for vector in self.files_with_identical_size.values() {
                    let tuple: (u64, usize, usize) = delete_files(vector, &self.delete_method, &mut self.text_messages, self.dryrun);
                    self.information.gained_space += tuple.0;
                    self.information.number_of_removed_files += tuple.1;
                    self.information.number_of_failed_to_remove_files += tuple.2;
                }
            }
            CheckingMethod::None => {
                //Just do nothing
                panic!("Checking method should never be none.");
            }
        }

        Common::print_time(start_time, SystemTime::now(), "delete_files".to_string());
    }
/// Function to delete files, from filed before BTreeMap
/// Using another function to delete files to avoid duplicates data
Function to delete files, from filed before BTreeMap
Using another function to delete files to avoid duplicates data
Function to delete files from filed before BTreeMap Using another function to delete files to avoid duplicates data
fn delete_files(&mut self) {
        let start_time: SystemTime = SystemTime::now();
        if self.delete_method == DeleteMethod::None {
            return;
        }
        match self.check_method {
            CheckingMethod::Name => {
                for vector in self.files_with_identical_names.values() {
                    let tuple: (u64, usize, usize) = delete_files(vector, &self.delete_method, &mut self.text_messages, self.dryrun);
                    self.information.gained_space += tuple.0;
                    self.information.number_of_removed_files += tuple.1;
                    self.information.number_of_failed_to_remove_files += tuple.2;
                }
            }
            CheckingMethod::Hash | CheckingMethod::HashMb => {
                for vector_vectors in self.files_with_identical_hashes.values() {
                    for vector in vector_vectors.iter() {
                        let tuple: (u64, usize, usize) = delete_files(vector, &self.delete_method, &mut self.text_messages, self.dryrun);
                        self.information.gained_space += tuple.0;
                        self.information.number_of_removed_files += tuple.1;
                        self.information.number_of_failed_to_remove_files += tuple.2;
                    }
                }
            }
            CheckingMethod::Size => {
                for vector in self.files_with_identical_size.values() {
                    let tuple: (u64, usize, usize) = delete_files(vector, &self.delete_method, &mut self.text_messages, self.dryrun);
                    self.information.gained_space += tuple.0;
                    self.information.number_of_removed_files += tuple.1;
                    self.information.number_of_failed_to_remove_files += tuple.2;
                }
            }
            CheckingMethod::None => {
                //Just do nothing
                panic!("Checking method should never be none.");
            }
        }
        Common::print_time(start_time, SystemTime::now(), "delete_files".to_string());
    }
fn delete_files ( & mut self ) { let start_time : SystemTime = SystemTime :: now ( ) ; if self . delete_method == DeleteMethod :: None { return ; } match self . check_method { CheckingMethod :: Name => { for vector in self . files_with_identical_names . values ( ) { let tuple : ( u64 , usize , usize ) = delete_files ( vector , & self . delete_method , & mut self . text_messages , self . dryrun ) ; self . information . gained_space += tuple . 0 ; self . information . number_of_removed_files += tuple . 1 ; self . information . number_of_failed_to_remove_files += tuple . 2 ; } } CheckingMethod :: Hash | CheckingMethod :: HashMb => { for vector_vectors in self . files_with_identical_hashes . values ( ) { for vector in vector_vectors . iter ( ) { let tuple : ( u64 , usize , usize ) = delete_files ( vector , & self . delete_method , & mut self . text_messages , self . dryrun ) ; self . information . gained_space += tuple . 0 ; self . information . number_of_removed_files += tuple . 1 ; self . information . number_of_failed_to_remove_files += tuple . 2 ; } } } CheckingMethod :: Size => { for vector in self . files_with_identical_size . values ( ) { let tuple : ( u64 , usize , usize ) = delete_files ( vector , & self . delete_method , & mut self . text_messages , self . dryrun ) ; self . information . gained_space += tuple . 0 ; self . information . number_of_removed_files += tuple . 1 ; self . information . number_of_failed_to_remove_files += tuple . 2 ; } } CheckingMethod :: None => { //Just do nothing panic ! ( " " ) ; } } Common :: print_time ( start_time , SystemTime :: now ( ) , " " . to_string ( ) ) ; }
Function to delete files, from filed before BTreeMap
Using another function to delete files to avoid duplicates data
Function to delete files from filed before BTreeMap Using another function to delete files to avoid duplicates data
&mut self
&mut self