diff options
author | Tim Oram <dev@mitmaro.ca> | 2018-10-25 23:54:12 -0230 |
---|---|---|
committer | Tim Oram <dev@mitmaro.ca> | 2018-10-26 00:29:11 -0230 |
commit | 54c0563a031029e67533cb613db23cfd71c3be2e (patch) | |
tree | c5a0ea799de2b2c2e05028715e845896a851aaf0 /src | |
parent | 9b04771eb563ebb02b1f7d7cd285d3f732e431eb (diff) |
Update dependencies
Diffstat (limited to 'src')
-rw-r--r-- | src/application.rs | 3 | ||||
-rw-r--r-- | src/git_config.rs | 10 | ||||
-rw-r--r-- | src/window.rs | 4 |
3 files changed, 8 insertions, 9 deletions
diff --git a/src/application.rs b/src/application.rs index e5805b0..00a7714 100644 --- a/src/application.rs +++ b/src/application.rs @@ -46,7 +46,7 @@ impl Application { State::List => { self.window.draw( self.git_interactive.get_lines(), - self.git_interactive.get_selected_line_index() + *self.git_interactive.get_selected_line_index() ); }, State::ShowCommit => { @@ -145,7 +145,6 @@ impl Application { Some(Input::KeyResize) => self.reset_top(), _ => {} } - () } fn reset_top(&mut self) { diff --git a/src/git_config.rs b/src/git_config.rs index 6487e64..2dd252f 100644 --- a/src/git_config.rs +++ b/src/git_config.rs @@ -13,18 +13,18 @@ impl GitConfig { match cfg { Ok(mut config) => { - match env::var_os("GIT_DIR") { - Some(val) => match val.into_string() { + if let Some(val) = env::var_os("GIT_DIR") { + match val.into_string() { Ok(s) => { let mut p = s.to_owned(); p.push_str("/config"); match config.add_file(Path::new(&p), ConfigLevel::Local, false) { - Ok(_v) => {}, Err(_e) => {} + Ok(_v) => {}, + Err(_e) => {} } }, Err(_e) => {} - }, - None => {} + } } Ok(GitConfig { diff --git a/src/window.rs b/src/window.rs index 15eecd4..7317cb5 100644 --- a/src/window.rs +++ b/src/window.rs @@ -72,7 +72,7 @@ impl Window { } } - pub fn draw(&self, lines: &[Line], selected_index: &usize) { + pub fn draw(&self, lines: &[Line], selected_index: usize) { self.window.clear(); self.draw_title(); let window_height = self.get_window_height(); @@ -88,7 +88,7 @@ impl Window { .skip(self.top) .take(window_height) { - self.draw_line(line, index == *selected_index); + self.draw_line(line, index == selected_index); index += 1; } if window_height < lines.len() - self.top { |