Skip to content

Commit

Permalink
scrubbed some useless to_string()s and changed an iter().skip().next(…
Browse files Browse the repository at this point in the history
…) to iter.nth()
  • Loading branch information
PureArtistry committed Nov 23, 2021
1 parent 1f61191 commit 0dd5981
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
9 changes: 1 addition & 8 deletions src/io_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,7 @@ fn get_cache_path(os_type: &str) -> Result<String> {

fn get_file_list(os_type: &str) -> Result<Vec<String>> {
let sep = sep_type(os_type);
let cache_path = [
get_cache_path(os_type)?,
sep.to_string(),
"oi".to_string(),
sep.to_string(),
"*.html".to_string()
]
.join("");
let cache_path = [&get_cache_path(os_type)?, sep, "oi", sep, "*.html"].join("");

let mut files: Vec<String> = vec![];
for x in glob(&cache_path).unwrap() {
Expand Down
3 changes: 1 addition & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@ fn main() {
match *x == "holidays" {
true if data
.select(&Selector::parse("div.wDYxhc").unwrap())
.skip(1)
.next()
.nth(1)
.unwrap()
.value()
.attr("data-attrid")
Expand Down

0 comments on commit 0dd5981

Please sign in to comment.