File tree Expand file tree Collapse file tree 4 files changed +22
-1
lines changed
Expand file tree Collapse file tree 4 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,9 @@ impl CommitList {
114114 self . marked . len ( )
115115 }
116116
117+ // Clippy wants this to be const in nightly, which is not possible.
118+ // Disable check to make clippy pass:
119+ #[ allow( clippy:: missing_const_for_fn) ]
117120 ///
118121 pub fn marked ( & self ) -> & [ ( usize , CommitId ) ] {
119122 & self . marked
Original file line number Diff line number Diff line change @@ -40,6 +40,11 @@ impl KeyConfig {
4040 Ok ( Self { keys, symbols } )
4141 }
4242
43+ // Clippy wants this to be const in nightly
44+ // This can't really be const, as deref into &str is not const, even
45+ // in nightly.
46+ // Disable clippy warning to build on nightly.
47+ #[ allow( clippy:: missing_const_for_fn) ]
4348 fn get_key_symbol ( & self , k : KeyCode ) -> & str {
4449 match k {
4550 KeyCode :: Enter => & self . symbols . enter ,
@@ -106,6 +111,11 @@ impl KeyConfig {
106111 }
107112 }
108113
114+ // Clippy wants this to be const in nightly
115+ // This can't really be const, as deref into &str is not const, even
116+ // in nightly.
117+ // Disable clippy warning to build on nightly.
118+ #[ allow( clippy:: missing_const_for_fn) ]
109119 fn get_modifier_hint ( & self , modifier : KeyModifiers ) -> & str {
110120 match modifier {
111121 KeyModifiers :: CONTROL => & self . symbols . control ,
Original file line number Diff line number Diff line change @@ -41,6 +41,10 @@ struct SyntaxFileBlame {
4141}
4242
4343impl SyntaxFileBlame {
44+ // Clippy wants this to be const in nightly.
45+ // This can't really be const, as deref into Path is not const.
46+ // Disable clippy warning to build on nightly.
47+ #[ allow( clippy:: missing_const_for_fn) ]
4448 fn path ( & self ) -> & str {
4549 & self . file_blame . path
4650 }
Original file line number Diff line number Diff line change @@ -167,9 +167,13 @@ impl SyntaxText {
167167 } )
168168 }
169169
170+ // Clippy wants this to be const in nightly.
171+ // This can't really be const, as deref into Path is not const.
172+ // Disable clippy warning to build on nightly.
173+ #[ allow( clippy:: missing_const_for_fn) ]
170174 ///
171175 pub fn path ( & self ) -> & Path {
172- & self . path
176+ self . path . as_path ( )
173177 }
174178}
175179
You can’t perform that action at this time.
0 commit comments