Skip to content

Commit

Permalink
[FOLD] Fix clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
scottschurr committed Jul 31, 2024
1 parent 66b56cc commit c9f6b5a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 29 deletions.
35 changes: 12 additions & 23 deletions include/xrpl/basics/Expected.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class [[nodiscard]] Expected

public:
template <typename U>
requires std::convertible_to<U, T> constexpr Expected(U&& r)
requires std::convertible_to<U, T> constexpr Expected(U && r)
: Base(T(std::forward<U>(r)))
{
}
Expand All @@ -148,32 +148,27 @@ class [[nodiscard]] Expected
{
}

constexpr bool
has_value() const
constexpr bool has_value() const
{
return Base::has_value();
}

constexpr T const&
value() const
constexpr T const& value() const
{
return Base::value();
}

constexpr T&
value()
constexpr T& value()
{
return Base::value();
}

constexpr E const&
error() const
constexpr E const& error() const
{
return Base::error();
}

constexpr E&
error()
constexpr E& error()
{
return Base::error();
}
Expand All @@ -186,26 +181,22 @@ class [[nodiscard]] Expected
// Add operator* and operator-> so the Expected API looks a bit more like
// what std::expected is likely to look like. See:
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0323r10.html
[[nodiscard]] constexpr T&
operator*()
[[nodiscard]] constexpr T& operator*()
{
return this->value();
}

[[nodiscard]] constexpr T const&
operator*() const
[[nodiscard]] constexpr T const& operator*() const
{
return this->value();
}

[[nodiscard]] constexpr T*
operator->()
[[nodiscard]] constexpr T* operator->()
{
return &this->value();
}

[[nodiscard]] constexpr T const*
operator->() const
[[nodiscard]] constexpr T const* operator->() const
{
return &this->value();
}
Expand Down Expand Up @@ -233,14 +224,12 @@ class [[nodiscard]] Expected<void, E>
{
}

constexpr E const&
error() const
constexpr E const& error() const
{
return Base::error();
}

constexpr E&
error()
constexpr E& error()
{
return Base::error();
}
Expand Down
3 changes: 1 addition & 2 deletions src/test/app/NFTokenBurn_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,7 @@ class NFTokenBurnBaseUtil_test : public beast::unit_test::suite
// Otherwise either alice or minter can burn.
AcctStat& burner = owner.acct == becky.acct
? *(stats[acctDist(engine)])
: mintDist(engine) ? alice
: minter;
: mintDist(engine) ? alice : minter;

if (owner.acct == burner.acct)
env(token::burn(burner, nft));
Expand Down
3 changes: 2 additions & 1 deletion src/xrpld/app/misc/detail/ValidatorList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,8 @@ ValidatorList::sendValidatorList(
beast::Journal j)
{
std::size_t const messageVersion =
peer.supportsFeature(ProtocolFeature::ValidatorList2Propagation) ? 2
peer.supportsFeature(ProtocolFeature::ValidatorList2Propagation)
? 2
: peer.supportsFeature(ProtocolFeature::ValidatorListPropagation) ? 1
: 0;
if (!messageVersion)
Expand Down
6 changes: 3 additions & 3 deletions src/xrpld/rpc/detail/ServerHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,9 @@ logDuration(
beast::Journal& journal)
{
using namespace std::chrono_literals;
auto const level = (duration >= 10s) ? journal.error()
: (duration >= 1s) ? journal.warn()
: journal.debug();
auto const level = (duration >= 10s)
? journal.error()
: (duration >= 1s) ? journal.warn() : journal.debug();

JLOG(level) << "RPC request processing duration = "
<< std::chrono::duration_cast<std::chrono::microseconds>(
Expand Down

0 comments on commit c9f6b5a

Please sign in to comment.