summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Zhao <jeff.no.zhao@gmail.com>2021-02-21 09:54:47 -0500
committerJeff Zhao <jeff.no.zhao@gmail.com>2021-02-21 09:54:47 -0500
commit2cddd505080a3c0c5cd71892e32e521ec541967b (patch)
treeb785f55348df017c5bc41e30df55a10c0f710e31
parent73e532152139e9d121e24a2d11cdece689e4fce9 (diff)
remove some code
-rw-r--r--src/config/mimetype.rs11
-rw-r--r--src/ui/views/tui_textfield.rs2
-rw-r--r--src/ui/widgets/tui_text.rs5
3 files changed, 2 insertions, 16 deletions
diff --git a/src/config/mimetype.rs b/src/config/mimetype.rs
index a5a28c2..9b82f08 100644
--- a/src/config/mimetype.rs
+++ b/src/config/mimetype.rs
@@ -32,13 +32,11 @@ impl JoshutoMimetypeEntry {
}
}
- #[allow(dead_code)]
pub fn arg<S: std::convert::Into<String>>(&mut self, arg: S) -> &mut Self {
self._args.push(arg.into());
self
}
- #[allow(dead_code)]
pub fn args<I, S>(&mut self, args: I) -> &mut Self
where
I: Iterator<Item = S>,
@@ -48,50 +46,41 @@ impl JoshutoMimetypeEntry {
self
}
- #[allow(dead_code)]
pub fn fork(&mut self, fork: bool) -> &mut Self {
self._fork = fork;
self
}
- #[allow(dead_code)]
pub fn silent(&mut self, silent: bool) -> &mut Self {
self._silent = silent;
self
}
- #[allow(dead_code)]
pub fn confirm_exit(&mut self, confirm_exit: bool) -> &mut Self {
self._confirm_exit = confirm_exit;
self
}
- #[allow(dead_code)]
pub fn get_command(&self) -> &str {
self._command.as_str()
}
- #[allow(dead_code)]
pub fn get_args(&self) -> &[String] {
&self._args
}
- #[allow(dead_code)]
pub fn get_fork(&self) -> bool {
self._fork
}
- #[allow(dead_code)]
pub fn get_silent(&self) -> bool {
self._silent
}
- #[allow(dead_code)]
pub fn get_confirm_exit(&self) -> bool {
self._confirm_exit
}
- #[allow(dead_code)]
pub fn execute_with<I, S>(&self, paths: I) -> std::io::Result<()>
where
I: IntoIterator<Item = S>,
diff --git a/src/ui/views/tui_textfield.rs b/src/ui/views/tui_textfield.rs
index 9262ec9..c341724 100644
--- a/src/ui/views/tui_textfield.rs
+++ b/src/ui/views/tui_textfield.rs
@@ -4,7 +4,7 @@ use rustyline::line_buffer;
use termion::event::{Event, Key};
use tui::layout::Rect;
use tui::widgets::Clear;
-use unicode_width::{UnicodeWidthChar, UnicodeWidthStr};
+use unicode_width::UnicodeWidthStr;
use crate::context::JoshutoContext;
use crate::ui::views::TuiView;
diff --git a/src/ui/widgets/tui_text.rs b/src/ui/widgets/tui_text.rs
index ba9cc36..7fa6935 100644
--- a/src/ui/widgets/tui_text.rs
+++ b/src/ui/widgets/tui_text.rs
@@ -24,9 +24,6 @@ impl<'a> TuiMultilineText<'a> {
// to clean this up more
let default_style = Style::default().fg(Color::Reset).bg(Color::Reset);
- let cursor_style = Style::default()
- .fg(Color::White)
- .add_modifier(Modifier::REVERSED);
let s_width = s.width();
if s_width < area_width {
@@ -51,7 +48,7 @@ impl<'a> TuiMultilineText<'a> {
let mut start = 0;
let mut line_width = 0;
- for (i, c, w) in s.char_indices().filter_map(filter) {
+ for (i, _, w) in s.char_indices().filter_map(filter) {
if line_width + w < area_width {
line_width += w;
continue;