diff --git a/src/components/commitlist.rs b/src/components/commitlist.rs index b181da65..2c4fff38 100644 --- a/src/components/commitlist.rs +++ b/src/components/commitlist.rs @@ -97,6 +97,9 @@ impl CommitList { } /// + //TODO: make const as soon as Option::::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() } diff --git a/src/components/reset.rs b/src/components/reset.rs index 2055964c..35e47609 100644 --- a/src/components/reset.rs +++ b/src/components/reset.rs @@ -157,7 +157,7 @@ impl ResetComponent { ), strings::confirm_msg_delete_branch( &self.key_config, - branch_ref.to_string(), + branch_ref, ), ), }; diff --git a/src/main.rs b/src/main.rs index cf085201..8a05275f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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; diff --git a/src/strings.rs b/src/strings.rs index dc75b4a2..bfdcf588 100644 --- a/src/strings.rs +++ b/src/strings.rs @@ -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) } diff --git a/src/ui/mod.rs b/src/ui/mod.rs index 85486d6e..9ec03804 100644 --- a/src/ui/mod.rs +++ b/src/ui/mod.rs @@ -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,