use std::error::Error; use reqwest::{ IntoUrl, Client, }; use rss::Channel as RawChannel; pub struct Channel { pub channel: rss::Channel, } pub async fn fetch_channel( client: &Client, url: T) -> Result> { let content = client.get(url) .send().await? .bytes().await?; let raw_channel = RawChannel::read_from(&content[..])?; println!("{}", raw_channel.title); Ok(Channel { channel: raw_channel }) }