@@ -39,7 +39,7 @@ impl GitHubApi {
39
39
40
40
fn build_request ( & self , method : Method , url : & str ) -> RequestBuilder {
41
41
let url = if !url. starts_with ( "https://" ) {
42
- format ! ( "https://api.github.com/{}" , url )
42
+ format ! ( "https://api.github.com/{url}" )
43
43
} else {
44
44
url. to_string ( )
45
45
} ;
@@ -57,7 +57,7 @@ impl GitHub for GitHubApi {
57
57
58
58
fn post_comment ( & self , issue_url : & str , body : & str ) -> Fallible < ( ) > {
59
59
let response = self
60
- . build_request ( Method :: POST , & format ! ( "{}/comments" , issue_url ) )
60
+ . build_request ( Method :: POST , & format ! ( "{issue_url }/comments" ) )
61
61
. json ( & json ! ( {
62
62
"body" : body,
63
63
} ) )
@@ -74,7 +74,7 @@ impl GitHub for GitHubApi {
74
74
75
75
fn list_labels ( & self , issue_url : & str ) -> Fallible < Vec < Label > > {
76
76
let response = self
77
- . build_request ( Method :: GET , & format ! ( "{}/labels" , issue_url ) )
77
+ . build_request ( Method :: GET , & format ! ( "{issue_url }/labels" ) )
78
78
. send ( ) ?;
79
79
80
80
let status = response. status ( ) ;
@@ -88,7 +88,7 @@ impl GitHub for GitHubApi {
88
88
89
89
fn add_label ( & self , issue_url : & str , label : & str ) -> Fallible < ( ) > {
90
90
let response = self
91
- . build_request ( Method :: POST , & format ! ( "{}/labels" , issue_url ) )
91
+ . build_request ( Method :: POST , & format ! ( "{issue_url }/labels" ) )
92
92
. json ( & json ! ( [ label] ) )
93
93
. send ( ) ?;
94
94
@@ -103,7 +103,7 @@ impl GitHub for GitHubApi {
103
103
104
104
fn remove_label ( & self , issue_url : & str , label : & str ) -> Fallible < ( ) > {
105
105
let response = self
106
- . build_request ( Method :: DELETE , & format ! ( "{}/labels/{}" , issue_url , label ) )
106
+ . build_request ( Method :: DELETE , & format ! ( "{issue_url }/labels/{label}" ) )
107
107
. send ( ) ?;
108
108
109
109
let status = response. status ( ) ;
@@ -117,7 +117,7 @@ impl GitHub for GitHubApi {
117
117
118
118
fn list_teams ( & self , org : & str ) -> Fallible < HashMap < String , usize > > {
119
119
let response = self
120
- . build_request ( Method :: GET , & format ! ( "orgs/{}/teams" , org ) )
120
+ . build_request ( Method :: GET , & format ! ( "orgs/{org }/teams" ) )
121
121
. send ( ) ?;
122
122
123
123
let status = response. status ( ) ;
@@ -132,7 +132,7 @@ impl GitHub for GitHubApi {
132
132
133
133
fn team_members ( & self , team : usize ) -> Fallible < Vec < String > > {
134
134
let response = self
135
- . build_request ( Method :: GET , & format ! ( "teams/{}/members" , team ) )
135
+ . build_request ( Method :: GET , & format ! ( "teams/{team }/members" ) )
136
136
. send ( ) ?;
137
137
138
138
let status = response. status ( ) ;
@@ -147,7 +147,7 @@ impl GitHub for GitHubApi {
147
147
148
148
fn get_commit ( & self , repo : & str , sha : & str ) -> Fallible < Commit > {
149
149
let commit = self
150
- . build_request ( Method :: GET , & format ! ( "repos/{}/commits/{}" , repo , sha ) )
150
+ . build_request ( Method :: GET , & format ! ( "repos/{repo }/commits/{sha}" ) )
151
151
. send ( ) ?
152
152
. error_for_status ( ) ?
153
153
. json ( ) ?;
@@ -156,7 +156,7 @@ impl GitHub for GitHubApi {
156
156
157
157
fn get_pr_head_sha ( & self , repo : & str , pr : i32 ) -> Fallible < String > {
158
158
let pr: PullRequestData = self
159
- . build_request ( Method :: GET , & format ! ( "repos/{}/pulls/{}" , repo , pr ) )
159
+ . build_request ( Method :: GET , & format ! ( "repos/{repo }/pulls/{pr}" ) )
160
160
. send ( ) ?
161
161
. error_for_status ( ) ?
162
162
. json ( ) ?;
0 commit comments