Skip to content

Commit

Permalink
Merge pull request #661 from Stremio/fix/clippy
Browse files Browse the repository at this point in the history
fix: clippy warnings
  • Loading branch information
elpiel authored Mar 22, 2024
2 parents 20f5277 + 282fcbc commit 0aa449d
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/models/local_search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ mod test {

assert_eq!(2, searchable_results.len());

let redirected_id = searchable_results.get(0).unwrap();
let redirected_id = searchable_results.first().unwrap();

assert!(redirected_id.name.is_empty());
assert!(redirected_id.poster.is_none());
Expand Down
4 changes: 1 addition & 3 deletions src/types/api/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,7 @@ mod tests {
None
}

fn body(self) -> () {
()
}
fn body(self) {}
}

let v2 = V2Request;
Expand Down
2 changes: 1 addition & 1 deletion src/unit_tests/ctx/add_to_library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ fn actionctx_addtolibrary() {
"One request has been sent"
);
assert_eq!(
REQUESTS.read().unwrap().get(0).unwrap().url.to_owned(),
REQUESTS.read().unwrap().first().unwrap().url.to_owned(),
"https://api.strem.io/api/datastorePut".to_owned(),
"datastorePut request has been sent"
);
Expand Down
6 changes: 3 additions & 3 deletions src/unit_tests/ctx/authenticate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ fn actionctx_authenticate_login() {
"Three requests have been sent"
);
assert_eq!(
REQUESTS.read().unwrap().get(0).unwrap().to_owned(),
REQUESTS.read().unwrap().first().unwrap().to_owned(),
Request {
url: "https://api.strem.io/api/login".to_owned(),
method: "POST".to_owned(),
Expand Down Expand Up @@ -396,7 +396,7 @@ fn actionctx_authenticate_login_with_token() {
"Three requests have been sent"
);
assert_eq!(
REQUESTS.read().unwrap().get(0).unwrap().to_owned(),
REQUESTS.read().unwrap().first().unwrap().to_owned(),
Request {
url: "https://api.strem.io/api/loginWithToken".to_owned(),
method: "POST".to_owned(),
Expand Down Expand Up @@ -607,7 +607,7 @@ fn actionctx_authenticate_register() {
"Three requests have been sent"
);
assert_eq!(
REQUESTS.read().unwrap().get(0).unwrap().to_owned(),
REQUESTS.read().unwrap().first().unwrap().to_owned(),
Request {
url: "https://api.strem.io/api/register".to_owned(),
method: "POST".to_owned(),
Expand Down
2 changes: 1 addition & 1 deletion src/unit_tests/ctx/install_addon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ fn actionctx_installaddon_install_with_user() {
"One request has been sent"
);
assert_eq!(
REQUESTS.read().unwrap().get(0).unwrap().to_owned(),
REQUESTS.read().unwrap().first().unwrap().to_owned(),
Request {
url: "https://api.strem.io/api/addonCollectionSet".to_owned(),
method: "POST".to_owned(),
Expand Down
2 changes: 1 addition & 1 deletion src/unit_tests/ctx/logout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ fn actionctx_logout() {
"One request has been sent"
);
assert_eq!(
REQUESTS.read().unwrap().get(0).unwrap().to_owned(),
REQUESTS.read().unwrap().first().unwrap().to_owned(),
Request {
url: "https://api.strem.io/api/logout".to_owned(),
method: "POST".to_owned(),
Expand Down
2 changes: 1 addition & 1 deletion src/unit_tests/ctx/pull_addons_from_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ fn actionctx_pulladdonsfromapi_with_user() {
"One request has been sent"
);
assert_eq!(
REQUESTS.read().unwrap().get(0).unwrap().url,
REQUESTS.read().unwrap().first().unwrap().url,
"https://api.strem.io/api/addonCollectionGet".to_owned(),
"addonCollectionGet request has been sent"
);
Expand Down
2 changes: 1 addition & 1 deletion src/unit_tests/ctx/push_addons_to_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ fn actionctx_pushaddonstoapi_with_user() {
"One request has been sent"
);
assert_eq!(
REQUESTS.read().unwrap().get(0).unwrap().to_owned(),
REQUESTS.read().unwrap().first().unwrap().to_owned(),
Request {
url: "https://api.strem.io/api/addonCollectionSet".to_owned(),
method: "POST".to_owned(),
Expand Down
2 changes: 1 addition & 1 deletion src/unit_tests/ctx/remove_from_library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ fn actionctx_removefromlibrary() {
"One request has been sent"
);
assert_eq!(
REQUESTS.read().unwrap().get(0).unwrap().url.to_owned(),
REQUESTS.read().unwrap().first().unwrap().url.to_owned(),
"https://api.strem.io/api/datastorePut".to_owned(),
"datastorePut request has been sent"
);
Expand Down
2 changes: 1 addition & 1 deletion src/unit_tests/ctx/rewind_library_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ fn actionctx_rewindlibraryitem() {
"One request has been sent"
);
assert_eq!(
REQUESTS.read().unwrap().get(0).unwrap().url.to_owned(),
REQUESTS.read().unwrap().first().unwrap().url.to_owned(),
"https://api.strem.io/api/datastorePut".to_owned(),
"datastorePut request has been sent"
);
Expand Down
4 changes: 2 additions & 2 deletions src/unit_tests/ctx/sync_library_with_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ fn actionctx_synclibrarywithapi_with_user() {
"Three requests have been sent"
);
assert_eq!(
REQUESTS.read().unwrap().get(0).unwrap().url,
REQUESTS.read().unwrap().first().unwrap().url,
"https://api.strem.io/api/datastoreMeta".to_owned(),
"datastoreMeta request has been sent"
);
Expand Down Expand Up @@ -447,7 +447,7 @@ fn actionctx_synclibrarywithapi_with_user_empty_library() {
"One request has been sent"
);
assert_eq!(
REQUESTS.read().unwrap().get(0).unwrap().url,
REQUESTS.read().unwrap().first().unwrap().url,
"https://api.strem.io/api/datastoreMeta".to_owned(),
"datastoreMeta request has been sent"
);
Expand Down
2 changes: 1 addition & 1 deletion src/unit_tests/ctx/uninstall_addon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ fn actionctx_uninstalladdon_with_user() {
"One request has been sent"
);
assert_eq!(
REQUESTS.read().unwrap().get(0).unwrap().to_owned(),
REQUESTS.read().unwrap().first().unwrap().to_owned(),
Request {
url: "https://api.strem.io/api/addonCollectionSet".to_owned(),
method: "POST".to_owned(),
Expand Down
2 changes: 1 addition & 1 deletion src/unit_tests/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ fn create_link_code() {
"Two requests have been sent"
);
assert_eq!(
REQUESTS.read().unwrap().get(0).unwrap().to_owned(),
REQUESTS.read().unwrap().first().unwrap().to_owned(),
Request {
url: "https://link.stremio.com/api/v2/create?type=Create".to_owned(),
method: "GET".to_owned(),
Expand Down

0 comments on commit 0aa449d

Please sign in to comment.