Skip to content

Commit

Permalink
chore: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Nereuxofficial committed Oct 3, 2024
1 parent b4d2669 commit 2d5114a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ fn main() -> Result<(), Box<dyn Error>> {
.block_on(async {
// Load Sponsors
SPONSORS
.set(Arc::new(RwLock::new(noncached_get_sponsors().await.unwrap())))
.set(Arc::new(RwLock::new(
noncached_get_sponsors().await.unwrap(),
)))
.unwrap();
let _ = Post::parse_all_posts().await.unwrap();
// Spawn a task to refresh them every hour
Expand Down
11 changes: 5 additions & 6 deletions src/post.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,11 @@ impl Post {
if cfg!(not(debug_assertions)) {
posts_list.retain(|post| post.metadata.draft != Some(true));
}
let _ = POSTS
.set(HashMap::from_iter(
posts_list
.iter()
.map(|post| (post.metadata.url.clone(), post.clone())),
));
let _ = POSTS.set(HashMap::from_iter(
posts_list
.iter()
.map(|post| (post.metadata.url.clone(), post.clone())),
));
posts_list.sort_by(|a, b| b.metadata.date.cmp(&a.metadata.date));
Ok(posts_list)
}
Expand Down

0 comments on commit 2d5114a

Please sign in to comment.