Skip to content

Commit

Permalink
0.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
veeso committed Aug 30, 2022
1 parent 49c0d37 commit 38c27af
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 14 deletions.
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Changelog

- [Changelog](#changelog)
- [0.3.1](#031)
- [0.3.2](#032)
- [0.3.1 (yanked)](#031-yanked)
- [0.3.0](#030)
- [0.2.1](#021)
- [0.2.0](#020)
Expand All @@ -10,7 +11,13 @@

---

## 0.3.1
## 0.3.2

Released on 30/08/2022

- Fixed articles sorted by date

## 0.3.1 (yanked)

Released on 30/08/2022

Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ license = "MIT"
name = "tuifeed"
readme = "README.md"
repository = "https://github.com/veeso/tuifeed"
version = "0.3.1"
version = "0.3.2"

[[bin]]
name = "tuifeed"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<p align="center">~ A terminal news feed reader with a fancy ui ~</p>

<p align="center">Developed by <a href="https://veeso.github.io/" target="_blank">@veeso</a></p>
<p align="center">Current version: 0.3.1 (30/08/2022)</p>
<p align="center">Current version: 0.3.2 (30/08/2022)</p>

<p align="center">
<a href="https://opensource.org/licenses/MIT"
Expand Down
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# -f, -y, --force, --yes
# Skip the confirmation prompt during installation

TUIFEED_VERSION="0.3.1"
TUIFEED_VERSION="0.3.2"
GITHUB_URL="https://github.com/veeso/tuifeed/releases/download/v${TUIFEED_VERSION}"
DEB_URL="${GITHUB_URL}/tuifeed_${TUIFEED_VERSION}_amd64.deb"
RPM_URL="${GITHUB_URL}/tuifeed-${TUIFEED_VERSION}-1.x86_64.rpm"
Expand Down
6 changes: 3 additions & 3 deletions src/feed/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ impl Feed {

impl From<RssFeed> for Feed {
fn from(feed: RssFeed) -> Self {
Self {
articles: feed.entries.into_iter().map(Article::from).collect(),
}
let mut articles: Vec<Article> = feed.entries.into_iter().map(Article::from).collect();
articles.sort_by_key(|x| std::cmp::Reverse(x.date));
Self { articles }
}
}

Expand Down
7 changes: 2 additions & 5 deletions src/ui/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,8 @@ impl Ui {
feed: &Feed,
max_title_len: usize,
) -> ArticleList {
// sort article by date
let mut sorted_articles: Vec<&Article> = feed.articles().collect();
sorted_articles.sort_by_key(|x| (*x).date);
let articles: Vec<String> = sorted_articles
.into_iter()
let articles: Vec<String> = feed
.articles()
.map(|x| Self::fmt_article_title_in_list(config, x, max_title_len))
.collect();
ArticleList::new(articles.as_slice())
Expand Down

0 comments on commit 38c27af

Please sign in to comment.