Skip to content

Commit

Permalink
Fix Result can't be serialized to string (apache#7034)
Browse files Browse the repository at this point in the history
  • Loading branch information
BewareMyPower authored and Huanli-Meng committed Jun 1, 2020
1 parent ed25a8a commit 2c0ebd3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pulsar-client-cpp/include/pulsar/Result.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ enum Result

// Return string representation of result code
PULSAR_PUBLIC const char* strResult(Result result);
} // namespace pulsar

PULSAR_PUBLIC std::ostream& operator<<(std::ostream& s, pulsar::Result result);
} // namespace pulsar

#endif /* ERROR_HPP_ */
6 changes: 4 additions & 2 deletions pulsar-client-cpp/lib/Result.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

#include <iostream>

using namespace pulsar;
namespace pulsar {

const char* pulsar::strResult(Result result) {
const char* strResult(Result result) {
switch (result) {
case ResultOk:
return "Ok";
Expand Down Expand Up @@ -152,3 +152,5 @@ const char* pulsar::strResult(Result result) {
}

PULSAR_PUBLIC std::ostream& operator<<(std::ostream& s, Result result) { return s << strResult(result); }

} // namespace pulsar

0 comments on commit 2c0ebd3

Please sign in to comment.