Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaance committed Mar 24, 2024
1 parent 927371b commit 1976034
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::hn_client::{HackerNewsClient, HackerNewsClientImpl, HackerNewsItem};
use crate::time_utils::{time_ago, unix_epoch_to_datetime};
use anyhow::Result;
use async_trait::async_trait;
use std::collections::HashSet;
use crate::time_utils::{time_ago, unix_epoch_to_datetime};

mod hn_client;
mod time_utils;
Expand Down Expand Up @@ -56,7 +56,7 @@ impl HackerNewsCliService for HackerNewsCliServiceImpl {
.get_story_ids(story_type)
.await
.unwrap_or_else(|_| panic!("Failed to get ids from story type {}", story_type));

// fetches a lot of ids by default, limit that by length given in args
let ids = &ids[..n as usize];
Ok(self
Expand Down Expand Up @@ -113,8 +113,8 @@ impl HackerNewsCliServiceImpl {
mod tests {
use super::*;
use crate::hn_client::MockHackerNewsClient;
use mockall::predicate;
use crate::time_utils::now;
use mockall::predicate;

#[test]
fn test_unix_epoch_to_datetime() {
Expand Down
2 changes: 1 addition & 1 deletion src/time_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ pub fn now() -> u64 {
.duration_since(std::time::UNIX_EPOCH)
.expect("Could not retrieve current time")
.as_secs()
}
}

0 comments on commit 1976034

Please # to comment.