removed unused mini-buffer feature, optimised imports/features

This commit is contained in:
Lynne Megido 2021-02-15 05:20:04 +10:00
parent ce721c20f6
commit 40292fe334
Signed by: lynnesbian
GPG key ID: F0A184B5213D9F90
3 changed files with 6 additions and 6 deletions

View file

@ -10,9 +10,8 @@ rust-version = "1.43.0" # cached requires 1.42.0
#license-file = "LICENSE" #license-file = "LICENSE"
[features] [features]
default = ["mini-buffer", "multi-threaded", "infer-backend"] default = ["multi-threaded", "infer-backend"]
mini-buffer = [] multi-threaded = ["rayon"]
multi-threaded = []
infer-backend = ["infer"] infer-backend = ["infer"]
xdg-mime-backend = ["xdg-mime"] xdg-mime-backend = ["xdg-mime"]
@ -21,9 +20,9 @@ walkdir = "2.3.1"
log = "0.4.14" log = "0.4.14"
smartstring = "0.2.6" smartstring = "0.2.6"
mime_guess = "2.0.3" mime_guess = "2.0.3"
rayon = "1.5.0"
snailquote = "0.3.0" snailquote = "0.3.0"
once_cell = "1.5.2" once_cell = "1.5.2"
rayon = { version = "1.5.0", optional = true }
infer = { version = "0.3.4", optional = true } infer = { version = "0.3.4", optional = true }
# use git version while waiting on a release incorporating https://github.com/ebassi/xdg-mime-rs/commit/de5a6dd # use git version while waiting on a release incorporating https://github.com/ebassi/xdg-mime-rs/commit/de5a6dd
xdg-mime = {git = "https://github.com/ebassi/xdg-mime-rs", version = "0.3", rev = "de5a6dd", optional = true } xdg-mime = {git = "https://github.com/ebassi/xdg-mime-rs", version = "0.3", rev = "de5a6dd", optional = true }

View file

@ -23,6 +23,7 @@ const BUF_SIZE: usize = 512;
pub fn mime_type<T: MimeDb>(db: &T, path: &Path) -> io::Result<Option<Mime>, > { pub fn mime_type<T: MimeDb>(db: &T, path: &Path) -> io::Result<Option<Mime>, > {
// attempt to read up to the BUF_SIZE bytes of the file // attempt to read up to the BUF_SIZE bytes of the file
let mut buffer = [0; 64]; let mut buffer = [0; 64];
let mut file = File::open(path)?; let mut file = File::open(path)?;

View file

@ -1,6 +1,6 @@
use std::str::FromStr;
use mime_guess::Mime; use mime_guess::Mime;
#[cfg(feature = "infer-backend")]
use std::str::FromStr;
pub trait MimeDb { pub trait MimeDb {
fn init() -> Self; fn init() -> Self;