feat: validate configuration

This commit is contained in:
Marc Plano-Lesay 2025-05-21 22:02:42 +10:00
parent ee7d7971be
commit 48c670f455
Signed by: kernald
GPG key ID: 66A41B08CC62A6CF
33 changed files with 1076 additions and 165 deletions

View file

@ -1,3 +1,4 @@
use crate::config::types::RedditUsername;
use chrono::{DateTime, TimeZone, Utc};
use color_eyre::eyre::{Result, WrapErr};
use roux::util::FeedOption;
@ -29,10 +30,10 @@ impl RedditClient {
/// * `post_count` - The maximum number of posts to fetch
pub async fn fetch_user_submissions(
&self,
username: &str,
username: &RedditUsername,
post_count: u32,
) -> Result<Vec<RedditPost>> {
let user = User::new(username);
let user = User::new(username.as_str());
let feed_option = FeedOption::new().limit(post_count);
let submissions = user
.submitted(Some(feed_option))