Browse Source

moved string_type mod into lib.rs

edition-2021
Lynne Megido 3 months ago
parent
commit
ebf2f152f0
Signed by: lynnesbian
GPG Key ID: F0A184B5213D9F90
  1. 2
      src/findings.rs
  2. 2
      src/inspectors.rs
  3. 12
      src/lib.rs
  4. 2
      src/parameters.rs
  5. 11
      src/string_type.rs
  6. 2
      src/tests/mod.rs

2
src/findings.rs

@ -3,7 +3,7 @@ use std::path::{Path, PathBuf};
use mime::Mime;
use crate::inspectors::mime_extension_lookup;
use crate::string_type::String;
use crate::String;
#[cfg(feature = "json")]
use serde::{ser::SerializeStruct, Serializer};

2
src/inspectors.rs

@ -9,7 +9,7 @@ use std::str::FromStr;
use cached::cached;
use mime::Mime;
use crate::string_type::String;
use crate::String;
use crate::MimeDb;
/// The number of bytes to read initially.

12
src/lib.rs

@ -7,14 +7,24 @@ pub mod formats;
pub mod inspectors;
pub mod mime_db;
pub mod parameters;
pub mod string_type;
pub mod utils;
use crate::findings::Findings;
use crate::mime_db::MimeDb;
use cfg_if::cfg_if;
use once_cell::sync::OnceCell;
cfg_if! {
if #[cfg(not(all(target_endian = "big", target_pointer_width = "32")))] {
// most architectures
pub use smartstring::alias::String;
} else {
// powerpc and other big endian 32-bit archs
pub use std::string::String;
}
}
cfg_if! {
if #[cfg(any(all(unix, feature = "infer-backend"), all(not(unix), not(feature = "xdg-mime-backend"))))] {
/// A [OnceCell] holding an instance of [mime_db::MimeDb].

2
src/parameters.rs

@ -1,6 +1,6 @@
//! [Clap] struct used to parse command line arguments.
use crate::string_type::String as StringType;
use crate::String as StringType;
use crate::utils::{clap_long_version, clap_version};
use cfg_if::cfg_if;
use clap::{AppSettings, Clap};

11
src/string_type.rs

@ -1,11 +0,0 @@
use cfg_if::cfg_if;
cfg_if! {
if #[cfg(not(all(target_endian = "big", target_pointer_width = "32")))] {
// most architectures
pub use smartstring::alias::String;
} else {
// powerpc and other big endian 32-bit archs
pub use std::string::String;
}
}

2
src/tests/mod.rs

@ -3,7 +3,7 @@ use fif::findings::Findings;
use fif::formats::{Format, PowerShell, Shell};
use fif::inspectors::{mime_extension_lookup, BUF_SIZE};
use fif::mime_db::MimeDb;
use fif::string_type::String;
use fif::String;
use crate::parameters::Parameters;
use clap::Clap;

Loading…
Cancel
Save