1
0
Fork 0
mirror of synced 2024-05-03 12:03:22 +12:00

Fixed release build printing debug prints

This commit is contained in:
Rafał Mikrut 2020-09-18 11:31:44 +02:00
parent a11f028966
commit 5d10e273a2
2 changed files with 12 additions and 10 deletions

View file

@ -32,14 +32,12 @@ pub struct EmptyFolder {
/// Info struck with helpful information's about results
pub struct Info {
#[cfg(debug_assertions)]
number_of_checked_folders: usize,
number_of_empty_folders: usize,
}
impl Info {
pub fn new() -> Info {
Info {
#[cfg(debug_assertions)]
number_of_checked_folders: 0,
number_of_empty_folders: 0,
}
@ -281,16 +279,20 @@ impl EmptyFolder {
}
/// Debug print
#[allow(dead_code)]
#[allow(unreachable_code)]
fn debug_print(&self) {
#[cfg(debug_assertions)]
#[cfg(not(debug_assertions))]
{
return;
}
println!("---------------DEBUG PRINT---------------");
println!("Number of all checked folders - {}", self.information.number_of_checked_folders);
println!("Number of empty folders - {}", self.information.number_of_empty_folders);
println!("Included directories - {:?}", self.included_directories);
println!("-----------------------------------------");
}
}
// TODO maybe move this and one from duplicated finder to one common class to avoid duplicating code
/// Optimize include and exclude directories by removing duplicates etc.