Skip to content

Commit

Permalink
ui(list news): display url and hide id
Browse files Browse the repository at this point in the history
  • Loading branch information
Thaumy committed Sep 12, 2023
1 parent 021277e commit c74c2ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
8 changes: 2 additions & 6 deletions src/display/colorful.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,8 @@ pub fn list_news(news_list: &Result<Vec<NewsEntry>>, rev: bool) {
.map(|dt| dt.format("%m-%d %H:%M").to_string())
.unwrap();

println!(
"{} {} {}",
create_time.dimmed(),
"#".dimmed(),
news.id.to_string().dimmed()
);
let url = format!("https://news.cnblogs.com/n/{}", news.id);
println!("{} {}", create_time.dimmed(), url.dimmed(),);
println!(" {}", news.title);
println!(" {}{}", news.summary.dimmed(), "...".dimmed());
println!();
Expand Down
3 changes: 2 additions & 1 deletion src/display/normal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ pub fn list_news(news_list: &Result<Vec<NewsEntry>>, rev: bool) {
.map(|dt| dt.format("%m-%d %H:%M").to_string())
.unwrap();

println!("{} # {}", create_time, news.id);
let url = format!("https://news.cnblogs.com/n/{}", news.id);
println!("{} {}", create_time, url);
println!(" {}", news.title);
println!(" {}...", news.summary);
println!();
Expand Down

0 comments on commit c74c2ca

Please sign in to comment.