|
13 | 13 | //! between 5,000ns and 100,000ns to find a MIME type.)
|
14 | 14 | //! - Check if a file *is* a certain type.
|
15 | 15 | //! - Handles aliases (ex: `application/zip` vs `application/x-zip-compressed`)
|
16 |
| -//! - Uses system [FreeDesktop.org magic files](https://specifications.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html) |
17 |
| -//! on Linux systems, and built-in magic file on Windows and macOS. |
18 | 16 | //! - Can delegate different file types to different "checkers", reducing false positives
|
19 | 17 | //! by choosing a different method of attack.
|
20 | 18 | //!
|
@@ -85,22 +83,12 @@ struct CheckerStruct {
|
85 | 83 |
|
86 | 84 | /// Maximum number of checkers supported with build config.
|
87 | 85 | /// TODO: Find any better way to do this!
|
88 |
| -#[cfg(not(feature="staticmime"))] |
89 |
| -const CHECKERCOUNT: usize = 3; |
90 |
| -#[cfg(feature="staticmime")] |
91 | 86 | const CHECKERCOUNT: usize = 2;
|
92 | 87 |
|
93 | 88 | /// List of checker functions
|
94 | 89 | const CHECKERS: [CheckerStruct; CHECKERCOUNT] =
|
95 | 90 | [
|
96 | 91 | // Disable sys checker when using staticmime
|
97 |
| - #[cfg(not(feature="staticmime"))] CheckerStruct{ |
98 |
| - from_u8: fdo_magic::sys::check::from_u8, |
99 |
| - from_filepath: fdo_magic::sys::check::from_filepath, |
100 |
| - get_supported: fdo_magic::sys::init::get_supported, |
101 |
| - get_subclasses: fdo_magic::sys::init::get_subclasses, |
102 |
| - get_aliaslist: fdo_magic::sys::init::get_aliaslist |
103 |
| - }, |
104 | 92 | CheckerStruct{
|
105 | 93 | from_u8: fdo_magic::builtin::check::from_u8,
|
106 | 94 | from_filepath: fdo_magic::builtin::check::from_filepath,
|
@@ -152,7 +140,6 @@ lazy_static! {
|
152 | 140 | #[derive(Clone)]
|
153 | 141 | pub enum Cache {
|
154 | 142 | FileCache(Vec<u8>),
|
155 |
| - #[cfg(not(feature="staticmime"))] FdoMagicSys(fdo_magic::sys::Cache), |
156 | 143 | FdoMagicBuiltin(fdo_magic::builtin::Cache),
|
157 | 144 | Basetype(basetype::Cache)
|
158 | 145 | }
|
|
0 commit comments