From 867055133d3f487e52dd44149f76347c2c28bf10 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 19 May 2020 18:55:58 +0100 Subject: style(3p/nix): Add braces around single-line conditionals These were not caught by the previous clang-tidy invocation, but were instead sorted out using amber[0] as such: ambr --regex 'if (\(.+\))\s([a-z].*;)' 'if $1 { $2 }' [0]: https://github.com/dalance/amber --- third_party/nix/src/libutil/ref.hh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'third_party/nix/src/libutil/ref.hh') diff --git a/third_party/nix/src/libutil/ref.hh b/third_party/nix/src/libutil/ref.hh index 5f0d7db4b6a1..063e6b327c22 100644 --- a/third_party/nix/src/libutil/ref.hh +++ b/third_party/nix/src/libutil/ref.hh @@ -17,11 +17,15 @@ class ref { ref(const ref& r) : p(r.p) {} explicit ref(const std::shared_ptr& p) : p(p) { - if (!p) throw std::invalid_argument("null pointer cast to ref"); + if (!p) { + throw std::invalid_argument("null pointer cast to ref"); + } } explicit ref(T* p) : p(p) { - if (!p) throw std::invalid_argument("null pointer cast to ref"); + if (!p) { + throw std::invalid_argument("null pointer cast to ref"); + } } T* operator->() const { return &*p; } -- cgit 1.4.1