diff options
| author | Nathan Jaremko | 2018-03-21 23:19:20 -0400 |
|---|---|---|
| committer | Nathan Jaremko | 2018-03-21 23:19:20 -0400 |
| commit | eb11c15038c358fc8c0794148d3b99d255c33206 (patch) | |
| tree | fd9b4774efd6fdd7171f8cfac1a184d21439732e /src/utils.rs | |
| parent | 36ec8131c0e71bad454aeb5e66c63f04cfb93e2c (diff) | |
| download | podcast-eb11c15038c358fc8c0794148d3b99d255c33206.tar.bz2 | |
Improve code
Diffstat (limited to 'src/utils.rs')
| -rw-r--r-- | src/utils.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/utils.rs b/src/utils.rs index 29bd15a..597d9b6 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -56,8 +56,7 @@ pub fn already_downloaded(dir: &str) -> Result<HashSet<String>, io::Error> { for entry in entries { let entry = entry?; match entry.file_name().into_string() { - Ok(val) => { - let name = String::from(val); + Ok(name) => { let index = name.find('.').unwrap(); result.insert(String::from(&name[0..index])); } @@ -118,7 +117,7 @@ pub fn parse_download_episodes(e_search: &str) -> Result<Vec<usize>, ParseIntErr let comma_separated: Vec<&str> = input.split(',').collect(); for elem in comma_separated { let temp = String::from(elem); - if temp.contains("-") { + if temp.contains('-') { let range: Vec<usize> = elem.split('-') .map(|i| i.parse::<usize>().unwrap()) .collect(); |
