clippy fixes

This commit is contained in:
Stephan Dilly 2020-06-22 12:32:01 +02:00
parent c38240927a
commit 86fafbd47b
5 changed files with 11 additions and 11 deletions

View file

@ -34,7 +34,7 @@ impl DetailsComponent {
Self {
data: None,
tags: Vec::new(),
theme: theme,
theme,
}
}

View file

@ -52,7 +52,7 @@ impl DiffComponent {
current_size: (0, 0),
selection: 0,
scroll_top: 0,
theme: theme,
theme,
}
}
///

View file

@ -128,12 +128,12 @@ impl FileTreeComponent {
changed
}
fn item_to_text(
fn item_to_text<'a>(
item: &FileTreeItem,
width: u16,
selected: bool,
theme: SharedTheme,
) -> Option<Text> {
theme: &'a SharedTheme,
) -> Option<Text<'a>> {
let indent_str = if item.info.indent == 0 {
String::from("")
} else {
@ -242,7 +242,7 @@ impl DrawableComponent for FileTreeComponent {
.tree
.selection
.map_or(false, |e| e == idx),
self.theme.clone(),
&self.theme,
)
},
);

View file

@ -5,11 +5,10 @@ use crate::{
},
queue::{Action, InternalEvent, Queue},
strings, ui,
ui::style::Theme,
};
use anyhow::Result;
use crossterm::event::{Event, KeyCode};
use std::{borrow::Cow, rc::Rc};
use std::borrow::Cow;
use strings::commands;
use tui::{
backend::Backend,
@ -17,13 +16,14 @@ use tui::{
widgets::{Clear, Text},
Frame,
};
use ui::style::SharedTheme;
///
pub struct ResetComponent {
target: Option<Action>,
visible: bool,
queue: Queue,
theme: Rc<Box<Theme>>,
theme: SharedTheme,
}
impl DrawableComponent for ResetComponent {
@ -111,7 +111,7 @@ impl Component for ResetComponent {
impl ResetComponent {
///
pub fn new(queue: Queue, theme: Rc<Box<Theme>>) -> Self {
pub fn new(queue: Queue, theme: SharedTheme) -> Self {
Self {
target: None,
visible: false,

View file

@ -37,7 +37,7 @@ impl TextInputComponent {
Self {
msg: String::default(),
visible: false,
theme: theme,
theme,
title: title.to_string(),
default_msg: default_msg.to_string(),
cursor_position: 0,