Remove protobuf_mutator::String
It was use for compartibility with protobuf versions which use
absl::string. They are not relevant anymore.
diff --git a/port/protobuf.h b/port/protobuf.h
index 9d3dc39..7aae273 100644
--- a/port/protobuf.h
+++ b/port/protobuf.h
@@ -51,9 +51,6 @@
namespace protobuf = google::protobuf;
-// String type used by google::protobuf.
-using String = std::string;
-
} // namespace protobuf_mutator
#endif // PORT_PROTOBUF_H_
diff --git a/src/binary_format.cc b/src/binary_format.cc
index 3455788..4fa9ef1 100644
--- a/src/binary_format.cc
+++ b/src/binary_format.cc
@@ -43,8 +43,8 @@
}
std::string SaveMessageAsBinary(const protobuf::Message& message) {
- String tmp;
- if (!message.SerializePartialToString(&tmp)) return {};
+ std::string tmp;
+ if (!message.SerializePartialToString(&tmp)) tmp.clear();
return tmp;
}
diff --git a/src/text_format.cc b/src/text_format.cc
index 39b2fdb..2e8dbc7 100644
--- a/src/text_format.cc
+++ b/src/text_format.cc
@@ -49,8 +49,8 @@
}
std::string SaveMessageAsText(const protobuf::Message& message) {
- String tmp;
- if (!protobuf::TextFormat::PrintToString(message, &tmp)) return {};
+ std::string tmp;
+ if (!protobuf::TextFormat::PrintToString(message, &tmp)) tmp.clear();
return tmp;
}