diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-04-25 09:10:04 -0400 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-04-25 09:10:04 -0400 |
commit | 53f530a1ec26fce4664634f9c22fbb51b12c3f42 (patch) | |
tree | 4496ea4bc068145ce6ff62940f54921b0b3e4604 /src/preview.rs | |
parent | e411fc0be674ff01b614802a1e706071593c6647 (diff) |
add option for enabling/disabling preview support
Diffstat (limited to 'src/preview.rs')
-rw-r--r-- | src/preview.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/preview.rs b/src/preview.rs index c207463..917fad7 100644 --- a/src/preview.rs +++ b/src/preview.rs @@ -1,11 +1,10 @@ use std::collections::{hash_map::Entry, HashMap}; -use std::ffi::OsStr; use std::io::BufRead; use std::path; use std::process; use crate::config::JoshutoConfig; -use crate::structs::{JoshutoDirEntry, JoshutoDirList}; +use crate::structs::JoshutoDirList; use crate::tab::JoshutoTab; use crate::ui; use crate::window::panel::JoshutoPanel; @@ -55,10 +54,10 @@ fn preview_directory( fn preview_file(path: &path::Path, win: &JoshutoPanel) { match path.extension() { - Some(file_ext) => { + Some(_file_ext) => { let mimetype_str = tree_magic::from_filepath(&path); /* mime subtype have second priority */ - if let Some(s) = MIMETYPE_T.mimetype.get(&mimetype_str) {} + if let Some(_s) = MIMETYPE_T.mimetype.get(&mimetype_str) {} /* generic mime type have last priority */ if let Some(s) = mimetype_str.find('/') { @@ -71,7 +70,7 @@ fn preview_file(path: &path::Path, win: &JoshutoPanel) { None => { let mimetype_str = tree_magic::from_filepath(&path); /* mime subtype have second priority */ - if let Some(s) = MIMETYPE_T.mimetype.get(&mimetype_str) {} + if let Some(_s) = MIMETYPE_T.mimetype.get(&mimetype_str) {} /* generic mime type have last priority */ if let Some(s) = mimetype_str.find('/') { |