Skip to content

Commit e868110

Browse files
committed
style: clippy
1 parent c0f6f87 commit e868110

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/display/colorful.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ pub fn list_ing(ing_list: &[(IngEntry, Vec<IngCommentEntry>)], rev: bool) {
4848
print!("{}", create_time.dimmed());
4949
if ing.is_lucky {
5050
let star_text = ing_star_tag_to_text(&ing.icons);
51-
print!(" {}", star_text.yellow());
52-
print!("{}", "⭐");
51+
print!(" {}⭐", star_text.yellow());
5352
}
5453
println!(" {} {}", "#".dimmed(), ing.id.to_string().dimmed());
5554
print!(" {}", ing.user_name.cyan());

src/display/normal.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,9 @@ pub fn list_ing(ing_list: &[(IngEntry, Vec<IngCommentEntry>)], rev: bool) {
4747
print!("{}", create_time);
4848
if ing.is_lucky {
4949
let star_text = ing_star_tag_to_text(&ing.icons);
50-
print!(" {}", star_text);
51-
print!("{}", "⭐");
50+
print!(" {}⭐", star_text);
5251
}
53-
println!(" {} {}", "#", ing.id.to_string());
52+
println!(" # {}", ing.id.to_string());
5453
let content = fmt_content(&ing.content);
5554
println!(" {}: {}", ing.user_name, content);
5655

@@ -65,7 +64,7 @@ pub fn list_ing(ing_list: &[(IngEntry, Vec<IngCommentEntry>)], rev: bool) {
6564
}
6665
let at_user = get_ing_at_user_tag_text(&entry.content);
6766
if at_user.is_empty().not() {
68-
print!(" {}{}", "@", at_user);
67+
print!(" @{}", at_user);
6968
}
7069
let content = {
7170
let content = rm_ing_at_user_tag(&entry.content);
@@ -124,15 +123,15 @@ pub fn show_post_meta(entry: &PostEntry) -> Result<()> {
124123
pub fn list_post(entry_list: &[PostEntry], total_count: usize, rev: bool) {
125124
println!("{}/{}", entry_list.len(), total_count);
126125
entry_list.iter().dyn_rev(rev).for_each(|entry| {
127-
print!("{} {}", "#", entry.id.to_string());
126+
print!("# {}", entry.id.to_string());
128127
print!(" {}", entry.title);
129128
if entry.is_published {
130-
print!(" {}", "Pub");
129+
print!(" Pub");
131130
} else {
132-
print!(" {}", "Dft");
131+
print!(" Dft");
133132
}
134133
if entry.is_pinned {
135-
print!(" {}", "Pin");
134+
print!(" Pin");
136135
}
137136
println!()
138137
});

0 commit comments

Comments
 (0)