diff --git a/src/auth.rs b/src/auth.rs index efb82700..4f276b8c 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -123,7 +123,7 @@ impl From for OAuth { token_type: value.token_type, scope: value.scope.split(',').map(ToString::to_string).collect(), expires_in: value.expires_in, - refresh_token: value.refresh_token.map(|t| SecretString::from(t)), + refresh_token: value.refresh_token.map(SecretString::from), refresh_token_expires_in: value.refresh_token_expires_in, } } diff --git a/src/models/events/payload/push.rs b/src/models/events/payload/push.rs index afe602ac..cc29634d 100644 --- a/src/models/events/payload/push.rs +++ b/src/models/events/payload/push.rs @@ -39,7 +39,7 @@ mod test { assert_eq!(payload.head, "eb1a60c03544dcea290f2d57bb66ae188ce25778"); assert_eq!(payload.before, "9b2afb3a8e03fb30cc09e5efb64823bde802cf59"); assert_eq!(payload.commits.len(), 1); - let commit = payload.commits.get(0).unwrap(); + let commit = payload.commits.first().unwrap(); assert_eq!(commit.sha, "eb1a60c03544dcea290f2d57bb66ae188ce25778"); assert_eq!( commit.author, diff --git a/tests/actions_self_hosted_runners.rs b/tests/actions_self_hosted_runners.rs index 83ba5fc2..e829eaf1 100644 --- a/tests/actions_self_hosted_runners.rs +++ b/tests/actions_self_hosted_runners.rs @@ -108,7 +108,7 @@ async fn test_context( }; let server = setup_api(scope, method_name, actions_uri, None::<()>, template).await; let client = Octocrab::builder() - .base_uri(&server.uri()) + .base_uri(server.uri()) .unwrap() .build() .unwrap(); @@ -137,7 +137,7 @@ async fn test_context_with_request_body( ) .await; let client = Octocrab::builder() - .base_uri(&server.uri()) + .base_uri(server.uri()) .unwrap() .build() .unwrap(); @@ -224,7 +224,7 @@ async fn should_return_org_jit_config() { let test_context = test_context_with_request_body( Scope::Org, "POST", - &format!("/actions/runners/generate-jitconfig"), + "/actions/runners/generate-jitconfig", StatusCode::CREATED, jit_config_req.clone(), Some(expected_response.clone()), @@ -263,7 +263,7 @@ async fn should_return_repo_jit_config() { let test_context = test_context_with_request_body( Scope::Repo, "POST", - &format!("/actions/runners/generate-jitconfig"), + "/actions/runners/generate-jitconfig", StatusCode::CREATED, jit_config_req.clone(), Some(expected_response.clone()), @@ -298,7 +298,7 @@ async fn should_return_org_registration_token() { let test_context = test_context( Scope::Org, "POST", - &format!("/actions/runners/registration-token"), + "/actions/runners/registration-token", StatusCode::CREATED, Some(expected_token.clone()), ) @@ -324,7 +324,7 @@ async fn should_return_repo_registration_token() { let test_context = test_context( Scope::Repo, "POST", - &format!("/actions/runners/registration-token"), + "/actions/runners/registration-token", StatusCode::CREATED, Some(expected_token.clone()), ) @@ -350,7 +350,7 @@ async fn should_return_org_remove_token() { let test_context = test_context( Scope::Org, "POST", - &format!("/actions/runners/remove-token"), + "/actions/runners/remove-token", StatusCode::CREATED, Some(expected_token.clone()), ) @@ -376,7 +376,7 @@ async fn should_return_repo_remove_token() { let test_context = test_context( Scope::Repo, "POST", - &format!("/actions/runners/remove-token"), + "/actions/runners/remove-token", StatusCode::CREATED, Some(expected_token.clone()), ) diff --git a/tests/repo_contributors_test.rs b/tests/repo_contributors_test.rs index 2d694422..ced3536c 100644 --- a/tests/repo_contributors_test.rs +++ b/tests/repo_contributors_test.rs @@ -56,7 +56,7 @@ async fn should_return_repo_contributors() { let contributors = result.unwrap(); - assert!(contributors.items.len() > 0); + assert!(!contributors.items.is_empty()); let Contributor { author: Author { login, .. },