12 lines
304 B
Rust
Executable File
12 lines
304 B
Rust
Executable File
use rss::Channel;
|
|
|
|
use super::net::safe_fetch;
|
|
use crate::error::AppError;
|
|
|
|
pub async fn get_feed(feed: &str) -> Result<Channel, AppError> {
|
|
let content = safe_fetch(feed).await?.bytes().await?;
|
|
let channel = Channel::read_from(&content[..])?;
|
|
log::debug!("{:?}", channel);
|
|
Ok(channel)
|
|
}
|