File tree 1 file changed +4
-2
lines changed
cpp-linter/src/rest_api/github
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1
1
//! This submodule implements functionality exclusively specific to Github's REST API.
2
2
3
3
use std:: {
4
+ collections:: HashMap ,
4
5
env,
5
6
fs:: OpenOptions ,
6
7
io:: { Read , Write } ,
@@ -149,7 +150,8 @@ impl GithubApiClient {
149
150
. remove_bot_comments ( & url, !update_only || ( is_lgtm && no_lgtm) )
150
151
. await ?;
151
152
if !is_lgtm || !no_lgtm {
152
- // log::debug!("payload body:\n{:?}", comment);
153
+ let payload = HashMap :: from ( [ ( "body" , comment) ] ) ;
154
+ // log::debug!("payload body:\n{:?}", payload);
153
155
let req_meth = if comment_url. is_some ( ) {
154
156
Method :: PATCH
155
157
} else {
@@ -159,7 +161,7 @@ impl GithubApiClient {
159
161
& self . client ,
160
162
comment_url. unwrap_or ( url) ,
161
163
req_meth,
162
- Some ( format ! ( r#"{{"body":"{comment}"}}"# ) ) ,
164
+ Some ( serde_json :: json! ( & payload ) . to_string ( ) ) ,
163
165
None ,
164
166
) ?;
165
167
match Self :: send_api_request (
You can’t perform that action at this time.
0 commit comments