From 2c0ebd3b60eda17088adcd8edf446a19078433bf Mon Sep 17 00:00:00 2001 From: Yunze Xu Date: Thu, 28 May 2020 01:22:56 +0800 Subject: [PATCH] Fix Result can't be serialized to string (#7034) --- pulsar-client-cpp/include/pulsar/Result.h | 2 +- pulsar-client-cpp/lib/Result.cc | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pulsar-client-cpp/include/pulsar/Result.h b/pulsar-client-cpp/include/pulsar/Result.h index 9a104737df599..b2a16c579236d 100644 --- a/pulsar-client-cpp/include/pulsar/Result.h +++ b/pulsar-client-cpp/include/pulsar/Result.h @@ -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_ */ diff --git a/pulsar-client-cpp/lib/Result.cc b/pulsar-client-cpp/lib/Result.cc index c57003cc9e878..fc4d81fa44fca 100644 --- a/pulsar-client-cpp/lib/Result.cc +++ b/pulsar-client-cpp/lib/Result.cc @@ -21,9 +21,9 @@ #include -using namespace pulsar; +namespace pulsar { -const char* pulsar::strResult(Result result) { +const char* strResult(Result result) { switch (result) { case ResultOk: return "Ok"; @@ -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