mirror of
https://github.com/lotabout/skim.git
synced 2026-09-10 07:16:23 -04:00
[lint] fix several warnings
This commit is contained in:
parent
eae4dd6e2e
commit
d99d04dc52
|
|
@ -29,7 +29,7 @@ impl Curses {
|
|||
use_color: false,
|
||||
}
|
||||
}
|
||||
pub fn init(&mut self, theme: Option<&ColorTheme>, is_black: bool, use_mouse: bool) {
|
||||
pub fn init(&mut self, theme: Option<&ColorTheme>, is_black: bool, _use_mouse: bool) {
|
||||
// initialize ncurses
|
||||
let local_conf = LcCategory::all;
|
||||
setlocale(local_conf, "en_US.UTF-8"); // for showing wide characters
|
||||
|
|
@ -53,13 +53,13 @@ impl Curses {
|
|||
}
|
||||
|
||||
fn init_pairs(&mut self, base: &ColorTheme, theme: &ColorTheme, is_black: bool) {
|
||||
let mut fg = shadow(base.fg, theme.fg);
|
||||
//let mut fg = shadow(base.fg, theme.fg);
|
||||
let mut bg = shadow(base.bg, theme.bg);
|
||||
|
||||
if is_black {
|
||||
bg = COLOR_BLACK;
|
||||
} else if theme.use_default {
|
||||
fg = COLOR_DEFAULT;
|
||||
//fg = COLOR_DEFAULT;
|
||||
bg = COLOR_DEFAULT;
|
||||
use_default_colors();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,8 +13,6 @@ use std::time::Duration;
|
|||
use util::eventbox::EventBox;
|
||||
use event::{Event, parse_action};
|
||||
|
||||
use ncurses::*;
|
||||
|
||||
pub struct Input {
|
||||
eb: Arc<EventBox<Event>>,
|
||||
keyboard: KeyBoard,
|
||||
|
|
@ -91,7 +89,7 @@ impl KeyBoard {
|
|||
let (tx, rx) = channel();
|
||||
thread::spawn(move || {
|
||||
for ch in f.chars() {
|
||||
tx.send(ch.unwrap());
|
||||
let _ = tx.send(ch.unwrap());
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
// An item is line of text that read from `find` command or stdin together with
|
||||
// the internal states, such as selected or not
|
||||
|
||||
use std;
|
||||
use std::cmp::Ordering;
|
||||
|
||||
pub struct Item {
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ fn main() {
|
|||
return
|
||||
}
|
||||
|
||||
let theme = curses::ColorTheme::new();
|
||||
let theme = ColorTheme::new();
|
||||
let mut curse = Curses::new();
|
||||
curse.init(Some(&theme), false, false);
|
||||
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ fn match_item(index: usize, item: &str, query: &str) -> Option<MatchedItem> {
|
|||
|
||||
|
||||
struct MatcherCache {
|
||||
matched_items: OrderedVec<MatchedItem>,
|
||||
pub matched_items: OrderedVec<MatchedItem>,
|
||||
pub item_pos: usize,
|
||||
}
|
||||
|
||||
|
|
@ -148,8 +148,4 @@ impl MatcherCache {
|
|||
matched_items: OrderedVec::new(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn push(&mut self, matched_item: MatchedItem) {
|
||||
self.matched_items.push(matched_item);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ use std::cell::RefCell;
|
|||
use std::collections::HashSet;
|
||||
use orderedvec::OrderedVec;
|
||||
use curses::*;
|
||||
use input::Key;
|
||||
use query::Query;
|
||||
use util::eventbox::EventBox;
|
||||
use event::Event;
|
||||
|
|
@ -157,7 +156,7 @@ impl Model {
|
|||
mv(y, 0);
|
||||
let is_current_line = y == self.line_cursor as i32;
|
||||
|
||||
let mut label = if is_current_line {">"} else {" "};
|
||||
let label = if is_current_line {">"} else {" "};
|
||||
|
||||
self.curses.cprint(COLOR_CURSOR, true, label);
|
||||
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ impl Query {
|
|||
pub fn delete_char(&mut self) -> bool {
|
||||
if self.index == self.query.len() { return false; }
|
||||
|
||||
let ch = self.query.remove(self.index);
|
||||
let _ = self.query.remove(self.index);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ extern crate libc;
|
|||
use std::process::{Command, Stdio};
|
||||
use std::sync::{Arc, RwLock};
|
||||
use std::io::{stdin, BufRead, BufReader};
|
||||
use std::sync::mpsc::Sender;
|
||||
use std::error::Error;
|
||||
use util::eventbox::EventBox;
|
||||
use event::Event;
|
||||
|
|
|
|||
Loading…
Reference in a new issue