diff options
| author | Nathan Jaremko | 2019-03-02 20:47:52 -0500 | 
|---|---|---|
| committer | Nathan Jaremko | 2019-03-02 20:48:12 -0500 | 
| commit | bfc821456a1164af45d79875c2793c02042efdd8 (patch) | |
| tree | fd37a5d8ee15edba46c6f70831a91166b91046dd /src/actions.rs | |
| parent | 394a7d9da0a21dd3453815ee9ecdfd10b1b479cd (diff) | |
| download | podcast-bfc821456a1164af45d79875c2793c02042efdd8.tar.bz2 | |
Improve extension handling
Diffstat (limited to 'src/actions.rs')
| -rw-r--r-- | src/actions.rs | 6 | 
1 files changed, 2 insertions, 4 deletions
| diff --git a/src/actions.rs b/src/actions.rs index c3ed2ac..c943769 100644 --- a/src/actions.rs +++ b/src/actions.rs @@ -66,11 +66,9 @@ pub fn update_subscription(sub: &mut Subscription) -> Result<()> {      let resp = reqwest::get(&sub.url)?;      let podcast = Podcast::from(Channel::read_from(BufReader::new(resp))?); -    let mut filename = String::from(podcast.title()); -    filename.push_str(".xml"); -      let mut podcast_rss_path = get_xml_dir()?; -    podcast_rss_path.push(&filename); +    podcast_rss_path.push(podcast.title()); +    podcast_rss_path.set_extension("xml");      let file = File::create(&podcast_rss_path)?;      (*podcast).write_to(BufWriter::new(file))?; | 
