refactor(library): various Rust style optimizations

Lots of small fixes to the APIs and functions in the `library` module,
mostly following best practices outlined in the Rust library guidelines.
Changes outside the `library` module were mostly required changes after
changing function signatures.
This commit is contained in:
Thomas Frans
2024-01-29 14:43:59 +01:00
committed by Henrik Friedrichsen
parent 97f10a9493
commit 7940365344
9 changed files with 202 additions and 125 deletions

View File

@@ -499,7 +499,7 @@ impl WebApi {
self.api_with_retry(|api| api.get_saved_show_manual(Some(50), Some(offset)))
}
pub fn save_shows(&self, ids: Vec<&str>) -> bool {
pub fn save_shows(&self, ids: &[&str]) -> bool {
self.api_with_retry(|api| {
api.save_shows(
ids.iter()
@@ -510,7 +510,7 @@ impl WebApi {
.is_some()
}
pub fn unsave_shows(&self, ids: Vec<&str>) -> bool {
pub fn unsave_shows(&self, ids: &[&str]) -> bool {
self.api_with_retry(|api| {
api.remove_users_saved_shows(
ids.iter()