Skip to content

Commit b51ce6a

Browse files
authored
chore: fix clippy (#148)
1 parent b69039c commit b51ce6a

File tree

6 files changed

+17
-15
lines changed

6 files changed

+17
-15
lines changed

src/commander/bookmarks.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ impl Display for Bookmark {
3333
text.push('@');
3434
text.push_str(remote);
3535
}
36-
write!(f, "{}", text)
36+
write!(f, "{text}")
3737
}
3838
}
3939

@@ -124,7 +124,7 @@ impl Commander {
124124
"bookmark",
125125
"list",
126126
"-T",
127-
&format!(r#"{} ++ "\n""#, BRANCH_TEMPLATE),
127+
&format!(r#"{BRANCH_TEMPLATE} ++ "\n""#),
128128
],
129129
args,
130130
]

src/commander/log.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ impl Commander {
108108
"log",
109109
"--template",
110110
// Match builtin_log_compact with 2 lines per change
111-
&format!(r#"{0} ++ " " ++ bookmarks ++"\n" ++ {0}"#, HEAD_TEMPLATE),
111+
&format!(
112+
r#"{HEAD_TEMPLATE} ++ " " ++ bookmarks ++"\n" ++ {HEAD_TEMPLATE}"#
113+
),
112114
],
113115
args,
114116
]
@@ -158,7 +160,7 @@ impl Commander {
158160
"log",
159161
"--no-graph",
160162
"--template",
161-
&format!(r#"{} ++ "\n""#, HEAD_TEMPLATE),
163+
&format!(r#"{HEAD_TEMPLATE} ++ "\n""#),
162164
"-r",
163165
"@",
164166
"--limit",
@@ -181,7 +183,7 @@ impl Commander {
181183
"log",
182184
"--no-graph",
183185
"--template",
184-
&format!(r#"{} ++ "\n""#, HEAD_TEMPLATE),
186+
&format!(r#"{HEAD_TEMPLATE} ++ "\n""#),
185187
"-r",
186188
head.change_id.as_str(),
187189
],
@@ -249,9 +251,9 @@ impl Commander {
249251
"log",
250252
"--no-graph",
251253
"--template",
252-
&format!(r#"{} ++ "\n""#, HEAD_TEMPLATE),
254+
&format!(r#"{HEAD_TEMPLATE} ++ "\n""#),
253255
"-r",
254-
&format!("{}-", commit_id),
256+
&format!("{commit_id}-"),
255257
"--limit",
256258
"1",
257259
],
@@ -321,7 +323,7 @@ impl Commander {
321323
"log",
322324
"--no-graph",
323325
"--template",
324-
&format!(r#"{} ++ "\n""#, HEAD_TEMPLATE),
326+
&format!(r#"{HEAD_TEMPLATE} ++ "\n""#),
325327
"-r",
326328
&bookmark.to_string(),
327329
"--limit",

src/ui/bookmark_set_popup.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ impl Component for BookmarkSetPopup<'_> {
201201
Text::raw("(C)reate bookmark").fg(Color::Yellow)
202202
}
203203
BookmarkSetOption::GeneratedName(generated_name, exists) => {
204-
let mut text = format!("(G)enerate bookmark: {}", generated_name);
204+
let mut text = format!("(G)enerate bookmark: {generated_name}");
205205
if *exists {
206206
text.push_str(" (exists)");
207207
}

src/ui/bookmarks_tab.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ impl Component for BookmarksTab<'_> {
400400
{
401401
let title = if let Some(BookmarkLine::Parsed { bookmark, .. }) = self.bookmark.as_ref()
402402
{
403-
format!(" Bookmark {} ", bookmark)
403+
format!(" Bookmark {bookmark} ")
404404
} else {
405405
" Bookmark ".to_owned()
406406
};
@@ -862,7 +862,7 @@ impl Component for BookmarksTab<'_> {
862862
Span::styled(" New ", Style::new().bold().cyan()),
863863
Text::from(vec![
864864
Line::from("Are you sure you want to create a new change?"),
865-
Line::from(format!("Bookmark: {}", bookmark)),
865+
Line::from(format!("Bookmark: {bookmark}")),
866866
]),
867867
);
868868
self.popup
@@ -900,7 +900,7 @@ impl Component for BookmarksTab<'_> {
900900
Span::styled(" Edit ", Style::new().bold().cyan()),
901901
Text::from(vec![
902902
Line::from("Are you sure you want to edit an existing change?"),
903-
Line::from(format!("Bookmark: {}", bookmark)),
903+
Line::from(format!("Bookmark: {bookmark}")),
904904
]),
905905
);
906906
self.popup

src/ui/command_popup.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ impl Component for CommandPopup<'_> {
9696
let message = match res {
9797
Ok(str) => str,
9898
Err(err) => [
99-
format!("Failed to execute jj command: jj {}", command_input),
99+
format!("Failed to execute jj command: jj {command_input}"),
100100
String::new(),
101101
err.to_string(),
102102
]
@@ -115,7 +115,7 @@ impl Component for CommandPopup<'_> {
115115
return Ok(ComponentInputResult::HandledAction(
116116
ComponentAction::Multiple(vec![
117117
ComponentAction::SetPopup(Some(Box::new(MessagePopup {
118-
title: format!("jj {}", command_input).into(),
118+
title: format!("jj {command_input}").into(),
119119
messages: message.into(),
120120
text_align: Alignment::Left.into(),
121121
}))),

src/ui/log_tab.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ impl Component for LogTab<'_> {
638638
};
639639

640640
let title = match &self.log_revset {
641-
Some(log_revset) => &format!(" Log for: {} ", log_revset),
641+
Some(log_revset) => &format!(" Log for: {log_revset} "),
642642
None => " Log ",
643643
};
644644

0 commit comments

Comments
 (0)