Skip to content

Commit 318498c

Browse files
author
Stephan Dilly
committed
more clippy fixes
1 parent a11da53 commit 318498c

File tree

3 files changed

+7
-26
lines changed

3 files changed

+7
-26
lines changed

src/components/create_branch.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,12 @@ use crate::{
99
ui::style::SharedTheme,
1010
};
1111
use anyhow::Result;
12-
use asyncgit::{
13-
sync::{self, CommitId},
14-
CWD,
15-
};
12+
use asyncgit::{sync, CWD};
1613
use crossterm::event::Event;
1714
use tui::{backend::Backend, layout::Rect, Frame};
1815

1916
pub struct CreateBranchComponent {
2017
input: TextInputComponent,
21-
commit_id: Option<CommitId>,
2218
queue: Queue,
2319
key_config: SharedKeyConfig,
2420
}
@@ -104,14 +100,12 @@ impl CreateBranchComponent {
104100
&strings::create_branch_popup_msg(&key_config),
105101
true,
106102
),
107-
commit_id: None,
108103
key_config,
109104
}
110105
}
111106

112107
///
113108
pub fn open(&mut self) -> Result<()> {
114-
self.commit_id = None;
115109
self.show()?;
116110

117111
Ok(())

src/components/filetree.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,6 @@ impl DrawableComponent for FileTreeComponent {
324324
r,
325325
self.title.as_str(),
326326
items.into_iter(),
327-
None,
328327
self.focused,
329328
&self.theme,
330329
);
@@ -368,7 +367,6 @@ impl DrawableComponent for FileTreeComponent {
368367
r,
369368
self.title.as_str(),
370369
items,
371-
Some(select),
372370
self.focused,
373371
&self.theme,
374372
);

src/ui/scrolllist.rs

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ where
1818
block: Option<Block<'b>>,
1919
/// Items to be displayed
2020
items: L,
21-
/// Index of the scroll position
22-
scroll: usize,
2321
/// Base style of the widget
2422
style: Style,
2523
}
@@ -32,7 +30,6 @@ where
3230
Self {
3331
block: None,
3432
items,
35-
scroll: 0,
3633
style: Style::default(),
3734
}
3835
}
@@ -41,11 +38,6 @@ where
4138
self.block = Some(block);
4239
self
4340
}
44-
45-
fn scroll(mut self, index: usize) -> Self {
46-
self.scroll = index;
47-
self
48-
}
4941
}
5042

5143
impl<'b, L> Widget for ScrollableList<'b, L>
@@ -68,19 +60,16 @@ pub fn draw_list<'b, B: Backend, L>(
6860
r: Rect,
6961
title: &'b str,
7062
items: L,
71-
select: Option<usize>,
7263
selected: bool,
7364
theme: &SharedTheme,
7465
) where
7566
L: Iterator<Item = Span<'b>>,
7667
{
77-
let list = ScrollableList::new(items)
78-
.block(
79-
Block::default()
80-
.title(Span::styled(title, theme.title(selected)))
81-
.borders(Borders::ALL)
82-
.border_style(theme.block(selected)),
83-
)
84-
.scroll(select.unwrap_or_default());
68+
let list = ScrollableList::new(items).block(
69+
Block::default()
70+
.title(Span::styled(title, theme.title(selected)))
71+
.borders(Borders::ALL)
72+
.border_style(theme.block(selected)),
73+
);
8574
f.render_widget(list, r)
8675
}

0 commit comments

Comments
 (0)