Skip to content

Commit

Permalink
Fix a bunch of clippy issues (#482)
Browse files Browse the repository at this point in the history
  • Loading branch information
Enselic authored Nov 1, 2023
1 parent e7631b0 commit da0ccab
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 20 deletions.
1 change: 0 additions & 1 deletion examples/github_app_authentication.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use octocrab::models::InstallationRepositories;
use octocrab::Octocrab;

#[tokio::main]
Expand Down
24 changes: 12 additions & 12 deletions src/api/projects/projects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ pub struct ListUserProjectsBuilder<'octo, 'r> {
impl<'octo, 'r> ListUserProjectsBuilder<'octo, 'r> {
pub fn new(handler: &'r ProjectHandler<'octo>, username: String) -> Self {
Self {
handler: handler,
username: username,
handler,
username,
per_page: None,
page: None,
}
Expand Down Expand Up @@ -198,7 +198,7 @@ impl<'octo, 'r> ListOrgProjectsBuilder<'octo, 'r> {
per_page: None,
page: None,
state: None,
org: org,
org,
}
}

Expand Down Expand Up @@ -247,8 +247,8 @@ impl<'octo, 'r> CreateOrgProjectsBuilder<'octo, 'r> {
Self {
handler,
body: None,
name: name,
org: org,
name,
org,
}
}

Expand Down Expand Up @@ -285,8 +285,8 @@ impl<'octo, 'r> ListRepositoryProjectsBuilder<'octo, 'r> {
handler,
per_page: None,
page: None,
owner: owner,
repo: repo,
owner,
repo,
}
}

Expand Down Expand Up @@ -342,10 +342,10 @@ impl<'octo, 'r> CreateRepositoryProjectsBuilder<'octo, 'r, NotNamed> {
per_page: None,
page: None,
body: None,
owner: owner,
repo: repo,
owner,
repo,
project_name: None,
_named: PhantomData::default(),
_named: PhantomData,
}
}

Expand All @@ -361,7 +361,7 @@ impl<'octo, 'r> CreateRepositoryProjectsBuilder<'octo, 'r, NotNamed> {
owner: self.owner,
repo: self.repo,
project_name: Some(name.into()),
_named: PhantomData::default(),
_named: PhantomData,
}
}
}
Expand All @@ -376,7 +376,7 @@ impl<'octo, 'r> CreateRepositoryProjectsBuilder<'octo, 'r, Named> {
owner: repo_builder.owner,
repo: repo_builder.repo,
project_name: repo_builder.project_name,
_named: PhantomData::default(),
_named: PhantomData,
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/projects_repo_list_projects_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ async fn should_list_repo_projects() {
serde_json::from_str(include_str!("resources/projects.json")).unwrap();

let test_login = repo_project[0].creator.login.clone();
let test_id = repo_project[1].id.clone();
let test_id = repo_project[1].id;

let page_response = FakePage {
items: repo_project,
Expand Down
8 changes: 2 additions & 6 deletions tests/projects_user_create_project_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,11 @@ async fn setup_api(template: ResponseTemplate) -> MockServer {
let mock_server = MockServer::start().await;

Mock::given(method("POST"))
.and(path(format!("/user/projects")))
.and(path("/user/projects"))
.respond_with(template)
.mount(&mock_server)
.await;
setup_error_handler(
&mock_server,
&format!("POST on /users/projects was not received"),
)
.await;
setup_error_handler(&mock_server, "POST on /users/projects was not received").await;
mock_server
}

Expand Down

0 comments on commit da0ccab

Please sign in to comment.