File tree 21 files changed +44
-24
lines changed
21 files changed +44
-24
lines changed Original file line number Diff line number Diff line change @@ -271,7 +271,7 @@ pub fn config_is_pull_rebase(repo_path: &RepoPath) -> Result<bool> {
271
271
let value =
272
272
rebase. value ( ) . map ( String :: from) . unwrap_or_default ( ) ;
273
273
return Ok ( value == "true" ) ;
274
- } ;
274
+ }
275
275
276
276
Ok ( false )
277
277
}
Original file line number Diff line number Diff line change @@ -55,7 +55,6 @@ pub fn amend(
55
55
/// Wrap `Repository::signature` to allow unknown user.name.
56
56
///
57
57
/// See <https://github.com/gitui-org/gitui/issues/79>.
58
- #[ allow( clippy:: redundant_pub_crate) ]
59
58
pub ( crate ) fn signature_allow_undefined_name (
60
59
repo : & Repository ,
61
60
) -> std:: result:: Result < Signature < ' _ > , git2:: Error > {
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ use crate::{
17
17
use crossbeam_channel:: Sender ;
18
18
use git2:: { PackBuilderStage , PushOptions } ;
19
19
use scopetime:: scope_time;
20
+ use std:: fmt:: Write as _;
20
21
21
22
///
22
23
pub trait AsyncProgress : Clone + Send + Sync {
@@ -182,7 +183,7 @@ pub fn push_raw(
182
183
if let Ok ( Some ( branch_upstream_merge) ) =
183
184
get_branch_upstream_merge ( repo_path, branch)
184
185
{
185
- push_ref . push_str ( & format ! ( ":{branch_upstream_merge}" ) ) ;
186
+ let _ = write ! ( push_ref , ":{branch_upstream_merge}" ) ;
186
187
}
187
188
}
188
189
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ impl TreeItemInfo {
55
55
Path :: new (
56
56
self . full_path
57
57
. components ( )
58
- . last ( )
58
+ . next_back ( )
59
59
. and_then ( |c| c. as_os_str ( ) . to_str ( ) )
60
60
. unwrap_or_default ( ) ,
61
61
)
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ impl<'a> Iterator for TreeItemsIterator<'a> {
35
35
* i += 1 ;
36
36
} else {
37
37
self . increments = Some ( 0 ) ;
38
- } ;
38
+ }
39
39
40
40
loop {
41
41
if !init {
Original file line number Diff line number Diff line change @@ -275,7 +275,7 @@ impl App {
275
275
3 => self . stashing_tab . draw ( f, chunks_main[ 1 ] ) ?,
276
276
4 => self . stashlist_tab . draw ( f, chunks_main[ 1 ] ) ?,
277
277
_ => bail ! ( "unknown tab" ) ,
278
- } ;
278
+ }
279
279
}
280
280
281
281
self . draw_popups ( f) ?;
@@ -905,7 +905,7 @@ impl App {
905
905
InternalEvent :: CommitSearch ( options) => {
906
906
self . revlog . search ( options) ;
907
907
}
908
- } ;
908
+ }
909
909
910
910
Ok ( flags)
911
911
}
@@ -997,7 +997,7 @@ impl App {
997
997
undo_last_commit( & self . repo. borrow( ) )
998
998
) ;
999
999
}
1000
- } ;
1000
+ }
1001
1001
1002
1002
flags. insert ( NeedsUpdate :: ALL ) ;
1003
1003
@@ -1019,7 +1019,7 @@ impl App {
1019
1019
) ) ;
1020
1020
1021
1021
self . tags_popup . update_tags ( ) ?;
1022
- } ;
1022
+ }
1023
1023
Ok ( ( ) )
1024
1024
}
1025
1025
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ impl ChangesComponent {
92
92
& self . repo . borrow ( ) ,
93
93
path,
94
94
) ?,
95
- } ;
95
+ }
96
96
} else {
97
97
let config =
98
98
self . options . borrow ( ) . status_show_untracked ( ) ;
Original file line number Diff line number Diff line change @@ -115,6 +115,10 @@ impl CommitList {
115
115
}
116
116
117
117
///
118
+ #[ expect(
119
+ clippy:: missing_const_for_fn,
120
+ reason = "as of 1.86.0 clippy wants this to be const even though that breaks"
121
+ ) ]
118
122
pub fn marked ( & self ) -> & [ ( usize , CommitId ) ] {
119
123
& self . marked
120
124
}
Original file line number Diff line number Diff line change @@ -176,7 +176,7 @@ impl TextInputComponent {
176
176
)
177
177
. title ( self . title . clone ( ) ) ,
178
178
) ;
179
- } ;
179
+ }
180
180
text_area
181
181
} ) ;
182
182
}
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ impl FileTreeItem {
90
90
91
91
match path
92
92
. components ( )
93
- . last ( )
93
+ . next_back ( )
94
94
. map ( std:: path:: Component :: as_os_str)
95
95
. map ( OsStr :: to_string_lossy)
96
96
. map ( String :: from)
Original file line number Diff line number Diff line change @@ -40,6 +40,10 @@ impl KeyConfig {
40
40
Ok ( Self { keys, symbols } )
41
41
}
42
42
43
+ #[ expect(
44
+ clippy:: missing_const_for_fn,
45
+ reason = "as of 1.86.0 clippy wants this to be const even though that breaks"
46
+ ) ]
43
47
fn get_key_symbol ( & self , k : KeyCode ) -> & str {
44
48
match k {
45
49
KeyCode :: Enter => & self . symbols . enter ,
@@ -106,6 +110,10 @@ impl KeyConfig {
106
110
}
107
111
}
108
112
113
+ #[ expect(
114
+ clippy:: missing_const_for_fn,
115
+ reason = "as of 1.86.0 clippy wants this to be const even though that breaks"
116
+ ) ]
109
117
fn get_modifier_hint ( & self , modifier : KeyModifiers ) -> & str {
110
118
match modifier {
111
119
KeyModifiers :: CONTROL => & self . symbols . control ,
Original file line number Diff line number Diff line change @@ -41,6 +41,10 @@ struct SyntaxFileBlame {
41
41
}
42
42
43
43
impl SyntaxFileBlame {
44
+ #[ expect(
45
+ clippy:: missing_const_for_fn,
46
+ reason = "as of 1.86.0 clippy wants this to be const even though that breaks"
47
+ ) ]
44
48
fn path ( & self ) -> & str {
45
49
& self . file_blame . path
46
50
}
Original file line number Diff line number Diff line change @@ -27,7 +27,9 @@ use ratatui::{
27
27
widgets:: Paragraph ,
28
28
Frame ,
29
29
} ;
30
+
30
31
use std:: {
32
+ fmt:: Write as _,
31
33
fs:: { read_to_string, File } ,
32
34
io:: { Read , Write } ,
33
35
path:: PathBuf ,
@@ -470,9 +472,7 @@ impl CommitPopup {
470
472
471
473
let mut msg = msg. to_owned ( ) ;
472
474
if let ( Some ( user) , Some ( mail) ) = ( user, mail) {
473
- msg. push_str ( & format ! (
474
- "\n \n Signed-off-by: {user} <{mail}>"
475
- ) ) ;
475
+ let _ = write ! ( msg, "\n \n Signed-off-by: {user} <{mail}>" ) ;
476
476
}
477
477
478
478
Ok ( msg)
Original file line number Diff line number Diff line change @@ -209,6 +209,6 @@ impl CreateRemotePopup {
209
209
210
210
self . hide ( ) ;
211
211
}
212
- } ;
212
+ }
213
213
}
214
214
}
Original file line number Diff line number Diff line change @@ -521,7 +521,7 @@ impl Component for FileRevlogPopup {
521
521
InspectCommitOpen :: new ( commit_id) ,
522
522
) ,
523
523
) ) ;
524
- } ;
524
+ }
525
525
} else if key_match ( key, self . key_config . keys . blame ) {
526
526
if let Some ( open_request) =
527
527
self . open_request . clone ( )
Original file line number Diff line number Diff line change @@ -207,7 +207,7 @@ impl OptionsPopup {
207
207
. borrow_mut ( )
208
208
. diff_hunk_lines_change ( true ) ;
209
209
}
210
- } ;
210
+ }
211
211
} else {
212
212
match self . selection {
213
213
AppOption :: StatusShowUntracked => {
@@ -246,7 +246,7 @@ impl OptionsPopup {
246
246
. borrow_mut ( )
247
247
. diff_hunk_lines_change ( false ) ;
248
248
}
249
- } ;
249
+ }
250
250
}
251
251
252
252
self . queue
Original file line number Diff line number Diff line change @@ -245,7 +245,7 @@ impl Component for Stashing {
245
245
} else {
246
246
Ok ( EventState :: NotConsumed )
247
247
} ;
248
- } ;
248
+ }
249
249
}
250
250
251
251
Ok ( EventState :: NotConsumed )
Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ impl StashList {
102
102
Action :: StashDrop ( ids) => self . drop ( repo, ids) ?,
103
103
Action :: StashPop ( id) => self . pop ( repo, * id) ?,
104
104
_ => ( ) ,
105
- } ;
105
+ }
106
106
107
107
Ok ( ( ) )
108
108
}
Original file line number Diff line number Diff line change @@ -348,7 +348,7 @@ impl Status {
348
348
349
349
self . diff . focus ( true ) ;
350
350
}
351
- } ;
351
+ }
352
352
353
353
self . update_diff ( ) ?;
354
354
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ impl Scrollbar {
49
49
let right = area. right ( ) . saturating_sub ( 1 ) ;
50
50
if right <= area. left ( ) {
51
51
return ;
52
- } ;
52
+ }
53
53
54
54
let ( bar_top, bar_height) = {
55
55
let scrollbar_area = area. inner ( Margin {
@@ -86,7 +86,7 @@ impl Scrollbar {
86
86
let bottom = area. bottom ( ) . saturating_sub ( 1 ) ;
87
87
if bottom <= area. top ( ) {
88
88
return ;
89
- } ;
89
+ }
90
90
91
91
let ( bar_left, bar_width) = {
92
92
let scrollbar_area = area. inner ( Margin {
Original file line number Diff line number Diff line change @@ -168,6 +168,10 @@ impl SyntaxText {
168
168
}
169
169
170
170
///
171
+ #[ expect(
172
+ clippy:: missing_const_for_fn,
173
+ reason = "as of 1.86.0 clippy wants this to be const even though that breaks"
174
+ ) ]
171
175
pub fn path ( & self ) -> & Path {
172
176
& self . path
173
177
}
You can’t perform that action at this time.
0 commit comments