clippy fixes

This commit is contained in:
Stephan Dilly 2020-10-11 16:06:44 +02:00
parent 0d2067fd13
commit 2df0a8957b
5 changed files with 6 additions and 4 deletions

View File

@ -97,6 +97,9 @@ impl CommitList {
}
///
//TODO: make const as soon as Option::<T>::as_ref
// is stabilizeD to be const (not as of rust 1.47)
#[allow(clippy::missing_const_for_fn)]
pub fn tags(&self) -> Option<&Tags> {
self.tags.as_ref()
}

View File

@ -157,7 +157,7 @@ impl ResetComponent {
),
strings::confirm_msg_delete_branch(
&self.key_config,
branch_ref.to_string(),
branch_ref,
),
),
};

View File

@ -8,7 +8,6 @@
#![deny(clippy::panic)]
#![allow(clippy::module_name_repetitions)]
#![allow(clippy::multiple_crate_versions)]
#![warn(clippy::missing_const_for_fn)]
mod app;
mod clipboard;

View File

@ -97,7 +97,7 @@ pub fn confirm_title_delete_branch(
}
pub fn confirm_msg_delete_branch(
_key_config: &SharedKeyConfig,
branch_ref: String,
branch_ref: &str,
) -> String {
format!("Confirm deleting branch: '{}' ?", branch_ref)
}

View File

@ -7,7 +7,7 @@ pub use scrolllist::draw_list;
use tui::layout::{Constraint, Direction, Layout, Rect};
/// return the scroll position (line) necessary to have the `selection` in view if it is not already
pub fn calc_scroll_top(
pub const fn calc_scroll_top(
current_top: usize,
height_in_lines: usize,
selection: usize,