Skip to content

Commit

Permalink
cargo fmt && clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Radiicall committed Apr 12, 2023
1 parent 4e2011a commit a7a7b47
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
16 changes: 8 additions & 8 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ pub struct Config {
pub blacklist: Blacklist,
pub rpc_client_id: String,
pub imgur_client_id: String,
pub images: Images
pub images: Images,
}

pub struct Blacklist {
pub types: Vec<MediaType>,
pub libraries: Vec<String>
pub libraries: Vec<String>,
}

pub struct Images {
Expand Down Expand Up @@ -115,10 +115,10 @@ impl Config {
.iter()
.for_each(|val| {
library_blacklist.push(
val
.as_str()
val.as_str()
.expect("Libraries to blacklist need to be in quotes \"music\"")
.to_lowercase())
.to_lowercase(),
)
});
}
let rpc_client_id = discord["APPLICATION_ID"]
Expand Down Expand Up @@ -171,14 +171,14 @@ impl Config {
username,
blacklist: Blacklist {
types: type_blacklist,
libraries: library_blacklist
libraries: library_blacklist,
},
rpc_client_id,
imgur_client_id,
images: Images {
enabled: enable_images,
imgur: imgur_images
}
imgur: imgur_images,
},
}),
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
});
for library in &config.blacklist.libraries {
if blacklist_check && !content.media_type.is_none() {
blacklist_check = library_check(&config.url, &config.api_key, &content.item_id, &library).await;
blacklist_check =
library_check(&config.url, &config.api_key, &content.item_id, library).await;
}
}

Expand Down
6 changes: 4 additions & 2 deletions src/services/jellyfin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,11 @@ pub async fn library_check(url: &str, api_key: &str, item_id: &str, library: &st
item_id,
api_key
))
.await.unwrap()
.await
.unwrap()
.text()
.await.unwrap(),
.await
.unwrap(),
)
.unwrap_or_else(|_| {
panic!(
Expand Down

0 comments on commit a7a7b47

Please sign in to comment.