diff options
| author | njaremko | 2017-07-17 21:53:57 -0400 |
|---|---|---|
| committer | njaremko | 2017-07-17 21:53:57 -0400 |
| commit | 599d3dcc21bd843ccbcd603c7f8b64789417845e (patch) | |
| tree | ff269bcabcb4e0a3b2653eb73bdcb767649b1243 /src/structs.rs | |
| parent | cd83d6ecaf7d9025c3db452268cf246ae4c4aaa0 (diff) | |
| download | podcast-599d3dcc21bd843ccbcd603c7f8b64789417845e.tar.bz2 | |
Sort imports
Diffstat (limited to 'src/structs.rs')
| -rw-r--r-- | src/structs.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/structs.rs b/src/structs.rs index 51f4fc1..c304832 100644 --- a/src/structs.rs +++ b/src/structs.rs @@ -1,10 +1,10 @@ use reqwest; use rss::{self, Channel, Item}; +use serde_json; +use std::collections::BTreeSet; use std::fs::{DirBuilder, File}; use std::io::{self, Read, Write}; use utils::*; -use serde_json; -use std::collections::BTreeSet; #[derive(Serialize, Deserialize, Clone)] pub struct Subscription { @@ -135,7 +135,7 @@ impl Episode { } } - pub fn download_extension(&self) -> Option<&str> { + pub fn extension(&self) -> Option<&str> { match self.0.enclosure() { Some(enclosure) => { match enclosure.mime_type() { @@ -158,7 +158,7 @@ impl Episode { if let Some(title) = self.title() { println!("Downloading: {}", title); let mut filename = String::from(title); - filename.push_str(self.download_extension().unwrap()); + filename.push_str(self.extension().unwrap()); path.push(filename); let mut file = File::create(&path)?; let mut resp = reqwest::get(url).unwrap(); |
