cargo fmt
This commit is contained in:
parent
557f5132ff
commit
fb81f26ff5
4 changed files with 18 additions and 22 deletions
14
src/files.rs
14
src/files.rs
|
@ -1,12 +1,12 @@
|
||||||
use log::{debug, error};
|
|
||||||
use cfg_if::cfg_if;
|
|
||||||
use walkdir::{DirEntry, WalkDir};
|
|
||||||
use std::collections::BTreeSet;
|
|
||||||
use crate::parameters::ScanOpts;
|
|
||||||
use mime_guess::from_ext;
|
|
||||||
use crate::findings::{Findings, ScanError};
|
use crate::findings::{Findings, ScanError};
|
||||||
|
use crate::parameters::ScanOpts;
|
||||||
use crate::{inspectors, MIMEDB};
|
use crate::{inspectors, MIMEDB};
|
||||||
|
use cfg_if::cfg_if;
|
||||||
|
use log::{debug, error};
|
||||||
|
use mime_guess::from_ext;
|
||||||
|
use std::collections::BTreeSet;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
use walkdir::{DirEntry, WalkDir};
|
||||||
|
|
||||||
cfg_if! {
|
cfg_if! {
|
||||||
if #[cfg(windows)] {
|
if #[cfg(windows)] {
|
||||||
|
@ -195,4 +195,4 @@ pub fn scan_directory(
|
||||||
} else {
|
} else {
|
||||||
Some(entries)
|
Some(entries)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
10
src/lib.rs
10
src/lib.rs
|
@ -1,19 +1,19 @@
|
||||||
#![forbid(unsafe_code)]
|
#![forbid(unsafe_code)]
|
||||||
#![warn(trivial_casts, unused_lifetimes, unused_qualifications)]
|
#![warn(trivial_casts, unused_lifetimes, unused_qualifications)]
|
||||||
|
|
||||||
pub mod mime_db;
|
pub mod files;
|
||||||
pub mod findings;
|
pub mod findings;
|
||||||
pub mod formats;
|
pub mod formats;
|
||||||
pub mod inspectors;
|
pub mod inspectors;
|
||||||
|
pub mod mime_db;
|
||||||
pub mod parameters;
|
pub mod parameters;
|
||||||
pub mod string_type;
|
pub mod string_type;
|
||||||
pub mod utils;
|
pub mod utils;
|
||||||
pub mod files;
|
|
||||||
|
|
||||||
use cfg_if::cfg_if;
|
|
||||||
use once_cell::sync::OnceCell;
|
|
||||||
use crate::findings::Findings;
|
use crate::findings::Findings;
|
||||||
use crate::mime_db::MimeDb;
|
use crate::mime_db::MimeDb;
|
||||||
|
use cfg_if::cfg_if;
|
||||||
|
use once_cell::sync::OnceCell;
|
||||||
|
|
||||||
cfg_if! {
|
cfg_if! {
|
||||||
if #[cfg(any(all(unix, feature = "infer-backend"), all(not(unix), not(feature = "xdg-mime-backend"))))] {
|
if #[cfg(any(all(unix, feature = "infer-backend"), all(not(unix), not(feature = "xdg-mime-backend"))))] {
|
||||||
|
@ -40,4 +40,4 @@ pub fn init_db() {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,11 +23,11 @@ use std::process::exit;
|
||||||
use clap::Clap;
|
use clap::Clap;
|
||||||
use log::{debug, error, info, trace, warn, Level};
|
use log::{debug, error, info, trace, warn, Level};
|
||||||
|
|
||||||
use fif::formats::Format;
|
|
||||||
use fif::parameters::{OutputFormat};
|
|
||||||
use fif::utils::{clap_long_version, os_name};
|
|
||||||
use fif::{init_db, parameters, formats};
|
|
||||||
use fif::files::{scan_directory, scan_from_walkdir};
|
use fif::files::{scan_directory, scan_from_walkdir};
|
||||||
|
use fif::formats::Format;
|
||||||
|
use fif::parameters::OutputFormat;
|
||||||
|
use fif::utils::{clap_long_version, os_name};
|
||||||
|
use fif::{formats, init_db, parameters};
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests;
|
mod tests;
|
||||||
|
@ -142,4 +142,3 @@ fn main() {
|
||||||
|
|
||||||
debug!("Done");
|
debug!("Done");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
|
use fif::files::{scan_directory, scan_from_walkdir};
|
||||||
use fif::findings::Findings;
|
use fif::findings::Findings;
|
||||||
use fif::formats::{Format, PowerShell, Shell};
|
use fif::formats::{Format, PowerShell, Shell};
|
||||||
use fif::inspectors::{mime_extension_lookup, BUF_SIZE};
|
use fif::inspectors::{mime_extension_lookup, BUF_SIZE};
|
||||||
use fif::mime_db::MimeDb;
|
use fif::mime_db::MimeDb;
|
||||||
use fif::string_type::String;
|
use fif::string_type::String;
|
||||||
use fif::files::{scan_directory, scan_from_walkdir};
|
|
||||||
|
|
||||||
use crate::parameters::Parameters;
|
use crate::parameters::Parameters;
|
||||||
use clap::Clap;
|
use clap::Clap;
|
||||||
|
@ -333,10 +333,7 @@ fn identify_random_bytes() {
|
||||||
for (mime, count) in &results {
|
for (mime, count) in &results {
|
||||||
println!("{}:\t{} counts", mime, count);
|
println!("{}:\t{} counts", mime, count);
|
||||||
}
|
}
|
||||||
println!(
|
println!("No type found:\t{} counts", 1000 - results.values().sum::<i32>());
|
||||||
"No type found:\t{} counts",
|
|
||||||
1000 - results.values().sum::<i32>()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
Loading…
Reference in a new issue