Commit 6840cc81 authored by Sergey Anpilov's avatar Sergey Anpilov Committed by Facebook GitHub Bot

Fix "unused parameter" in getValueOrUnit in non-debug builds

Summary:
`value` could trigger "unused parameter" warning in NDEBUG builds. The fix is straightforward, to use the new-ish `[[maybe_unused]]` attribute.

The alternatives are to use `FOLLY_MAYBE_UNUSED` or even manual `(void)value;`. But since this is coroutines library, it should be reasonably safe to assume the compiler supports the cleaner and more expressive native C++17 option.

Reviewed By: lewissbaker

Differential Revision: D21784931

fbshipit-source-id: 895bf95d65df6533d768b65c44a898a73e0a636f
parent c85f8af6
......@@ -30,7 +30,7 @@ T&& getValueOrUnit(Try<T>&& value) {
return std::move(value).value();
}
inline Unit getValueOrUnit(Try<void>&& value) {
inline Unit getValueOrUnit([[maybe_unused]] Try<void>&& value) {
assert(value.hasValue());
return Unit{};
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment