Skip to content

Commit

Permalink
review findings
Browse files Browse the repository at this point in the history
Signed-off-by: Rainer Schoenberger <[email protected]>
  • Loading branch information
rainerschoe committed Feb 26, 2024
1 parent d53eeb2 commit 6b7b96b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/libCli/MessageFormatterJson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace cli
// Will print primitive fields regardless of their values. So e.g. an int32 field set to 0 will not be omitted.
printOptions.always_print_primitive_fields = true;

auto status = google::protobuf::util::MessageToJsonString(f_message, &resultString, printOptions);
const auto status = google::protobuf::util::MessageToJsonString(f_message, &resultString, printOptions);
if(not status.ok())
{
resultString = std::string("Json encoding of Message failed: ") + status.ToString();
Expand Down
3 changes: 1 addition & 2 deletions src/libCli/MessageParserJson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,8 @@ std::vector<std::unique_ptr<google::protobuf::Message>> MessageParserJson::parse
}
std::stringstream buffer;
buffer << source->rdbuf();
std::string fileContent = buffer.str();
auto status = google::protobuf::util::JsonStringToMessage(
fileContent,
buffer.str(),
message.get(),
google::protobuf::util::JsonParseOptions());
if(not status.ok())
Expand Down

0 comments on commit 6b7b96b

Please sign in to comment.