diff options
Diffstat (limited to 'src/feed.rs')
-rw-r--r-- | src/feed.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/feed.rs b/src/feed.rs index f9a7893..77f1a45 100644 --- a/src/feed.rs +++ b/src/feed.rs | |||
@@ -104,6 +104,7 @@ impl Feed { | |||
104 | 104 | ||
105 | // update entries | 105 | // update entries |
106 | self.entries = entries.into_iter().map(Result::unwrap).collect(); | 106 | self.entries = entries.into_iter().map(Result::unwrap).collect(); |
107 | self.entries.sort_by(|a, b| b.published.cmp(&a.published)); | ||
107 | 108 | ||
108 | Ok(pull_status) | 109 | Ok(pull_status) |
109 | } | 110 | } |
@@ -166,16 +167,16 @@ impl fmt::Display for Entry { | |||
166 | f, | 167 | f, |
167 | "{} {} {}", | 168 | "{} {} {}", |
168 | self.published.format(crate::DATE_FMT), | 169 | self.published.format(crate::DATE_FMT), |
170 | Style::new().dimmed().paint(self.title.to_ascii_lowercase()), | ||
169 | Style::new().fg(Color::Cyan).paint( | 171 | Style::new().fg(Color::Cyan).paint( |
170 | self.link | 172 | self.link |
171 | .as_str() | 173 | .as_str() |
172 | .trim_end_matches('/') | 174 | .trim_end_matches('/') |
173 | .trim_start_matches("http://") | ||
174 | .trim_start_matches("https://") | ||
175 | .trim_start_matches("http://www.") | 175 | .trim_start_matches("http://www.") |
176 | .trim_start_matches("https://www.") | 176 | .trim_start_matches("https://www.") |
177 | .trim_start_matches("https://") | ||
178 | .trim_start_matches("http://") | ||
177 | ), | 179 | ), |
178 | Style::new().dimmed().paint(self.title.to_ascii_lowercase()), | ||
179 | ) | 180 | ) |
180 | } | 181 | } |
181 | } | 182 | } |