Skip to content

Commit 6ede63f

Browse files
committed
Remove protobuf_mutator::String
It was use for compartibility with protobuf versions which use absl::string. They are not relevant anymore.
1 parent 6bbfde6 commit 6ede63f

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

port/protobuf.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ namespace protobuf_mutator {
5151

5252
namespace protobuf = google::protobuf;
5353

54-
// String type used by google::protobuf.
55-
using String = std::string;
56-
5754
} // namespace protobuf_mutator
5855

5956
#endif // PORT_PROTOBUF_H_

src/binary_format.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ size_t SaveMessageAsBinary(const Message& message, uint8_t* data,
4343
}
4444

4545
std::string SaveMessageAsBinary(const protobuf::Message& message) {
46-
String tmp;
47-
if (!message.SerializePartialToString(&tmp)) return {};
46+
std::string tmp;
47+
if (!message.SerializePartialToString(&tmp)) tmp.clear();
4848
return tmp;
4949
}
5050

src/text_format.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ size_t SaveMessageAsText(const Message& message, uint8_t* data,
4949
}
5050

5151
std::string SaveMessageAsText(const protobuf::Message& message) {
52-
String tmp;
53-
if (!protobuf::TextFormat::PrintToString(message, &tmp)) return {};
52+
std::string tmp;
53+
if (!protobuf::TextFormat::PrintToString(message, &tmp)) tmp.clear();
5454
return tmp;
5555
}
5656

0 commit comments

Comments
 (0)