Skip to content

Commit

Permalink
move history debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
danitrap committed Dec 31, 2023
1 parent 52ab2b9 commit 7cf58f0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use std::collections::{HashSet, LinkedList};
use std::fmt;
use std::hash::{Hash, Hasher};
use std::rc::Rc;
use std::task::Wake;

#[derive(Clone, Debug)]
pub struct HnItem {
Expand Down Expand Up @@ -73,6 +74,7 @@ impl HackerNews {
.collect::<Vec<_>>();

self.truncate();
log::debug!("History now contains {} items", self.history.len());

if new_items.is_empty() {
None
Expand All @@ -88,7 +90,6 @@ impl HackerNews {
let item = Rc::new(item);
self.items.insert(Rc::clone(&item));
self.history.push_front(Rc::clone(&item));
log::debug!("History now contains {} items", self.history.len());
AddItemResult::Added(item)
}
}
Expand Down

0 comments on commit 7cf58f0

Please sign in to comment.