Skip to content

Commit f765aa6

Browse files
committed
revert comment serialization tweak
1 parent e16ff13 commit f765aa6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cpp-linter/src/rest_api/github/specific_api.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! This submodule implements functionality exclusively specific to Github's REST API.
22
33
use std::{
4+
collections::HashMap,
45
env,
56
fs::OpenOptions,
67
io::{Read, Write},
@@ -149,7 +150,8 @@ impl GithubApiClient {
149150
.remove_bot_comments(&url, !update_only || (is_lgtm && no_lgtm))
150151
.await?;
151152
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);
153155
let req_meth = if comment_url.is_some() {
154156
Method::PATCH
155157
} else {
@@ -159,7 +161,7 @@ impl GithubApiClient {
159161
&self.client,
160162
comment_url.unwrap_or(url),
161163
req_meth,
162-
Some(format!(r#"{{"body":"{comment}"}}"#)),
164+
Some(serde_json::json!(&payload).to_string()),
163165
None,
164166
)?;
165167
match Self::send_api_request(

0 commit comments

Comments
 (0)