You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by GitBox <gi...@apache.org> on 2022/11/09 02:49:04 UTC

[GitHub] [incubator-kvrocks] PragmaTwice commented on a diff in pull request #1080: New status methods

PragmaTwice commented on code in PR #1080:
URL: https://github.com/apache/incubator-kvrocks/pull/1080#discussion_r1017352320


##########
tests/cppunit/status_test.cc:
##########
@@ -26,7 +26,7 @@
 TEST(StatusOr, Scalar) {
   auto f = [](int x) -> StatusOr<int> {
     if (x > 10) {
-      return {Status::NotOK, "x large than 10"};
+      return Status::NotOK("x large than 10");

Review Comment:
   Actually the original code `{Status::NotOK, "x large than 10"}` here is typed `StatusOr<int>`, i.e. it equals `StatusOr<int>{Status::NotOK, "x large than 10"}`, and the new code `Status::NotOK("x large than 10")` is typed `Status`. Although since we have a constructor `StatusOr<T>(Status)` so it will go well.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org