Nest all namespaces

The compiler supports this now.  We can type less going forward.
No functional changes.

Signed-off-by: Stephan Pleines <pleines.stephan@gmail.com>
Change-Id: I29d6fa4f9aacc0e381f1a7637294db0392466995
diff --git a/aos/actions/action_test.cc b/aos/actions/action_test.cc
index ea46ed8..c7c3c48 100644
--- a/aos/actions/action_test.cc
+++ b/aos/actions/action_test.cc
@@ -13,10 +13,7 @@
 #include "aos/events/simulated_event_loop.h"
 #include "aos/testing/path.h"
 
-namespace aos {
-namespace common {
-namespace actions {
-namespace testing {
+namespace aos::common::actions::testing {
 
 namespace chrono = ::std::chrono;
 
@@ -515,7 +512,4 @@
   event_loop_factory_.RunFor(chrono::seconds(2));
 }
 
-}  // namespace testing
-}  // namespace actions
-}  // namespace common
-}  // namespace aos
+}  // namespace aos::common::actions::testing
diff --git a/aos/actions/actions.cc b/aos/actions/actions.cc
index 764cb6c..133101b 100644
--- a/aos/actions/actions.cc
+++ b/aos/actions/actions.cc
@@ -1,8 +1,6 @@
 #include "aos/actions/actions.h"
 
-namespace aos {
-namespace common {
-namespace actions {
+namespace aos::common::actions {
 
 void ActionQueue::EnqueueAction(::std::unique_ptr<Action> action) {
   if (current_action_) {
@@ -70,6 +68,4 @@
   return false;
 }
 
-}  // namespace actions
-}  // namespace common
-}  // namespace aos
+}  // namespace aos::common::actions
diff --git a/aos/actions/actor.cc b/aos/actions/actor.cc
index 6a91c74..727b7a9 100644
--- a/aos/actions/actor.cc
+++ b/aos/actions/actor.cc
@@ -1,7 +1 @@
 #include "aos/actions/actor.h"
-
-namespace aos {
-namespace common {
-namespace actions {}  // namespace actions
-}  // namespace common
-}  // namespace aos
diff --git a/aos/condition_test.cc b/aos/condition_test.cc
index c83dc19..1551cb0 100644
--- a/aos/condition_test.cc
+++ b/aos/condition_test.cc
@@ -21,8 +21,7 @@
 #include "aos/time/time.h"
 #include "aos/type_traits/type_traits.h"
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 
 namespace chrono = ::std::chrono;
 
@@ -382,5 +381,4 @@
   EXPECT_FALSE(child3.Hung());
 }
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/configuration_test.cc b/aos/configuration_test.cc
index 560e5eb..e5fe303 100644
--- a/aos/configuration_test.cc
+++ b/aos/configuration_test.cc
@@ -13,9 +13,7 @@
 #include "aos/testing/test_logging.h"
 #include "aos/util/file.h"
 
-namespace aos {
-namespace configuration {
-namespace testing {
+namespace aos::configuration::testing {
 
 using aos::testing::ArtifactPath;
 namespace chrono = std::chrono;
@@ -1168,6 +1166,4 @@
   ASSERT_EQ(971, channel->frequency());
 }
 
-}  // namespace testing
-}  // namespace configuration
-}  // namespace aos
+}  // namespace aos::configuration::testing
diff --git a/aos/containers/error_list_test.cc b/aos/containers/error_list_test.cc
index b819ba5..94eabf9 100644
--- a/aos/containers/error_list_test.cc
+++ b/aos/containers/error_list_test.cc
@@ -4,8 +4,7 @@
 
 #include "aos/json_to_flatbuffer_generated.h"
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 
 enum class TestEnum : int8_t {
   FOO = 0,
@@ -112,5 +111,4 @@
   EXPECT_EQ(b.size(), 3);
 }
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/containers/inlined_vector_test.cc b/aos/containers/inlined_vector_test.cc
index 7368844..c9f2dd2 100644
--- a/aos/containers/inlined_vector_test.cc
+++ b/aos/containers/inlined_vector_test.cc
@@ -6,8 +6,7 @@
 
 DECLARE_bool(die_on_malloc);
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 
 // Checks that we don't malloc until/unless we need to increase the size of the
 // vector.
@@ -45,5 +44,4 @@
   zero.push_back(1);
   ASSERT_EQ(1, zero[0]);
 }
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/containers/priority_queue_test.cc b/aos/containers/priority_queue_test.cc
index 64456c4..f27a206 100644
--- a/aos/containers/priority_queue_test.cc
+++ b/aos/containers/priority_queue_test.cc
@@ -2,8 +2,7 @@
 
 #include "gtest/gtest.h"
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 
 // Effectively copies the implementation of ::std::less just to demonstrate how
 // things work.
@@ -172,5 +171,4 @@
   EXPECT_EQ(11, it->a);
 }
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/containers/ring_buffer_test.cc b/aos/containers/ring_buffer_test.cc
index b4cf1fb..c06ef0e 100644
--- a/aos/containers/ring_buffer_test.cc
+++ b/aos/containers/ring_buffer_test.cc
@@ -3,8 +3,7 @@
 #include "glog/logging.h"
 #include "gtest/gtest.h"
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 
 // A class which is implicitly convertible to and from int, and tracks object
 // lifetimes.
@@ -206,5 +205,4 @@
   EXPECT_EQ(i, buffer_.size());
 }
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/containers/sized_array_test.cc b/aos/containers/sized_array_test.cc
index d055f40..645d669 100644
--- a/aos/containers/sized_array_test.cc
+++ b/aos/containers/sized_array_test.cc
@@ -2,8 +2,7 @@
 
 #include "gtest/gtest.h"
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 
 // Tests the various ways of accessing elements.
 TEST(SizedArrayTest, ElementAccess) {
@@ -240,5 +239,4 @@
   EXPECT_EQ(a.size(), 1);
 }
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/die_test.cc b/aos/die_test.cc
index 8c0a703..6b33b50 100644
--- a/aos/die_test.cc
+++ b/aos/die_test.cc
@@ -2,13 +2,11 @@
 
 #include "gtest/gtest.h"
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 
 TEST(DieDeathTest, Works) {
   EXPECT_EXIT(Die("str=%s num=%d\n", "hi", 5),
               ::testing::KilledBySignal(SIGABRT), ".*str=hi num=5\n");
 }
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/events/epoll.cc b/aos/events/epoll.cc
index 340d0cd..8c5c3e1 100644
--- a/aos/events/epoll.cc
+++ b/aos/events/epoll.cc
@@ -15,8 +15,7 @@
 
 #include "aos/time/time.h"
 
-namespace aos {
-namespace internal {
+namespace aos::internal {
 
 TimerFd::TimerFd()
     : fd_(timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC | TFD_NONBLOCK)) {
@@ -298,5 +297,4 @@
       << ": Failed to " << operation << " epoll fd: " << event_data->fd;
 }
 
-}  // namespace internal
-}  // namespace aos
+}  // namespace aos::internal
diff --git a/aos/events/epoll_test.cc b/aos/events/epoll_test.cc
index b725747..e1be563 100644
--- a/aos/events/epoll_test.cc
+++ b/aos/events/epoll_test.cc
@@ -6,9 +6,7 @@
 #include "glog/logging.h"
 #include "gtest/gtest.h"
 
-namespace aos {
-namespace internal {
-namespace testing {
+namespace aos::internal::testing {
 
 // A simple wrapper around both ends of a pipe along with some helpers to easily
 // read/write data through it.
@@ -204,6 +202,4 @@
   epoll_.Run();
 }
 
-}  // namespace testing
-}  // namespace internal
-}  // namespace aos
+}  // namespace aos::internal::testing
diff --git a/aos/events/event_loop_param_test.cc b/aos/events/event_loop_param_test.cc
index 5ec494f..58bfd9b 100644
--- a/aos/events/event_loop_param_test.cc
+++ b/aos/events/event_loop_param_test.cc
@@ -15,8 +15,7 @@
 #include "aos/logging/logging.h"
 #include "aos/realtime.h"
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 namespace {
 namespace chrono = ::std::chrono;
 }  // namespace
@@ -3692,5 +3691,4 @@
   EXPECT_EQ(SendTestMessage(sender1), RawSender::Error::kMessagesSentTooFast);
 }
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/events/glib_main_loop_test.cc b/aos/events/glib_main_loop_test.cc
index aabab68..6fced6d 100644
--- a/aos/events/glib_main_loop_test.cc
+++ b/aos/events/glib_main_loop_test.cc
@@ -10,8 +10,7 @@
 #include "aos/events/shm_event_loop.h"
 #include "aos/testing/path.h"
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 using aos::testing::ArtifactPath;
 
 const FlatbufferDetachedBuffer<Configuration> &Config() {
@@ -128,5 +127,4 @@
   EXPECT_EQ(runs, 1);
 }
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/events/logging/config_remapper_test.cc b/aos/events/logging/config_remapper_test.cc
index a1fedb2..f33f421 100644
--- a/aos/events/logging/config_remapper_test.cc
+++ b/aos/events/logging/config_remapper_test.cc
@@ -14,8 +14,7 @@
 #include "aos/testing/tmpdir.h"
 #include "multinode_logger_test_lib.h"
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 using namespace logger::testing;
 using namespace logger;
 namespace chrono = std::chrono;
@@ -97,5 +96,4 @@
   EXPECT_EQ(channel->type()->string_view(), "aos.timing.Report");
 }
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/events/logging/log_namer.cc b/aos/events/logging/log_namer.cc
index 6682ae3..3bbca3b 100644
--- a/aos/events/logging/log_namer.cc
+++ b/aos/events/logging/log_namer.cc
@@ -19,8 +19,7 @@
 
 DECLARE_int32(flush_size);
 
-namespace aos {
-namespace logger {
+namespace aos::logger {
 
 NewDataWriter::NewDataWriter(LogNamer *log_namer, const Node *node,
                              const Node *logger_node,
@@ -1192,5 +1191,4 @@
                      &data_writer->writer);
 }
 
-}  // namespace logger
-}  // namespace aos
+}  // namespace aos::logger
diff --git a/aos/events/logging/log_writer.cc b/aos/events/logging/log_writer.cc
index bc81a4b..f840c22 100644
--- a/aos/events/logging/log_writer.cc
+++ b/aos/events/logging/log_writer.cc
@@ -13,8 +13,7 @@
 #include "aos/network/timestamp_channel.h"
 #include "aos/sha256.h"
 
-namespace aos {
-namespace logger {
+namespace aos::logger {
 namespace {
 using message_bridge::RemoteMessage;
 namespace chrono = std::chrono;
@@ -921,5 +920,4 @@
   }
 }
 
-}  // namespace logger
-}  // namespace aos
+}  // namespace aos::logger
diff --git a/aos/events/logging/logfile_sorting.cc b/aos/events/logging/logfile_sorting.cc
index f67a88a..2eaf00b 100644
--- a/aos/events/logging/logfile_sorting.cc
+++ b/aos/events/logging/logfile_sorting.cc
@@ -27,8 +27,7 @@
 DEFINE_bool(quiet_sorting, false,
             "If true, sort with minimal messages about truncated files.");
 
-namespace aos {
-namespace logger {
+namespace aos::logger {
 namespace {
 namespace chrono = std::chrono;
 
@@ -2381,5 +2380,4 @@
   return false;
 }
 
-}  // namespace logger
-}  // namespace aos
+}  // namespace aos::logger
diff --git a/aos/events/logging/logfile_utils_test.cc b/aos/events/logging/logfile_utils_test.cc
index ea56d8d..30a0ada 100644
--- a/aos/events/logging/logfile_utils_test.cc
+++ b/aos/events/logging/logfile_utils_test.cc
@@ -22,9 +22,7 @@
 #include "aos/testing/tmpdir.h"
 #include "aos/util/file.h"
 
-namespace aos {
-namespace logger {
-namespace testing {
+namespace aos::logger::testing {
 namespace chrono = std::chrono;
 using aos::message_bridge::RemoteMessage;
 using aos::testing::ArtifactPath;
@@ -3386,6 +3384,4 @@
   }
 }
 
-}  // namespace testing
-}  // namespace logger
-}  // namespace aos
+}  // namespace aos::logger::testing
diff --git a/aos/events/logging/logger_test.cc b/aos/events/logging/logger_test.cc
index 5990a7a..3f0b182 100644
--- a/aos/events/logging/logger_test.cc
+++ b/aos/events/logging/logger_test.cc
@@ -26,9 +26,7 @@
 #include "aos/events/logging/lzma_encoder.h"
 #endif
 
-namespace aos {
-namespace logger {
-namespace testing {
+namespace aos::logger::testing {
 
 namespace chrono = std::chrono;
 using aos::message_bridge::RemoteMessage;
@@ -579,6 +577,4 @@
   EXPECT_EQ(replay_count, sent_messages);
 }
 
-}  // namespace testing
-}  // namespace logger
-}  // namespace aos
+}  // namespace aos::logger::testing
diff --git a/aos/events/logging/multinode_logger_test.cc b/aos/events/logging/multinode_logger_test.cc
index b8d07a2..3c438e3 100644
--- a/aos/events/logging/multinode_logger_test.cc
+++ b/aos/events/logging/multinode_logger_test.cc
@@ -12,9 +12,7 @@
 #include "aos/network/timestamp_generated.h"
 #include "aos/testing/tmpdir.h"
 
-namespace aos {
-namespace logger {
-namespace testing {
+namespace aos::logger::testing {
 
 namespace chrono = std::chrono;
 using aos::message_bridge::RemoteMessage;
@@ -4682,6 +4680,4 @@
   auto result = ConfirmReadable(filenames);
 }
 
-}  // namespace testing
-}  // namespace logger
-}  // namespace aos
+}  // namespace aos::logger::testing
diff --git a/aos/events/logging/multinode_logger_test_lib.cc b/aos/events/logging/multinode_logger_test_lib.cc
index 9b3e00c..ed62a2e 100644
--- a/aos/events/logging/multinode_logger_test_lib.cc
+++ b/aos/events/logging/multinode_logger_test_lib.cc
@@ -11,9 +11,7 @@
 
 DECLARE_bool(force_timestamp_loading);
 
-namespace aos {
-namespace logger {
-namespace testing {
+namespace aos::logger::testing {
 
 using aos::testing::ArtifactPath;
 
@@ -626,6 +624,4 @@
   return result;
 }
 
-}  // namespace testing
-}  // namespace logger
-}  // namespace aos
+}  // namespace aos::logger::testing
diff --git a/aos/events/pingpong_test.cc b/aos/events/pingpong_test.cc
index d35192a..c52e8eb 100644
--- a/aos/events/pingpong_test.cc
+++ b/aos/events/pingpong_test.cc
@@ -7,8 +7,7 @@
 #include "aos/json_to_flatbuffer.h"
 #include "aos/testing/path.h"
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 
 using aos::testing::ArtifactPath;
 
@@ -168,5 +167,4 @@
   EXPECT_EQ(pi2_ping_count, 1001);
 }
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/events/shm_event_loop_test.cc b/aos/events/shm_event_loop_test.cc
index 2134687..4db0c7d 100644
--- a/aos/events/shm_event_loop_test.cc
+++ b/aos/events/shm_event_loop_test.cc
@@ -10,8 +10,7 @@
 #include "aos/network/team_number.h"
 #include "aos/realtime.h"
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 namespace {
 namespace chrono = ::std::chrono;
 
@@ -447,5 +446,4 @@
 INSTANTIATE_TEST_SUITE_P(ShmEventLoopPinDeathTest, ShmEventLoopDeathTest,
                          ::testing::Values(ReadMethod::PIN));
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/events/simulated_event_loop_test.cc b/aos/events/simulated_event_loop_test.cc
index 23badae..050c9a3 100644
--- a/aos/events/simulated_event_loop_test.cc
+++ b/aos/events/simulated_event_loop_test.cc
@@ -19,8 +19,7 @@
 #include "aos/network/timestamp_generated.h"
 #include "aos/testing/path.h"
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 namespace {
 
 using aos::testing::ArtifactPath;
@@ -2462,5 +2461,4 @@
   }
 }
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/events/simulated_network_bridge.cc b/aos/events/simulated_network_bridge.cc
index 3ed39fa..5c97292 100644
--- a/aos/events/simulated_network_bridge.cc
+++ b/aos/events/simulated_network_bridge.cc
@@ -7,8 +7,7 @@
 #include "aos/events/simulated_event_loop.h"
 #include "aos/network/remote_message_generated.h"
 
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
 
 // This class delays messages forwarded between two factories.
 //
@@ -760,5 +759,4 @@
   });
 }
 
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge
diff --git a/aos/events/timing_statistics.cc b/aos/events/timing_statistics.cc
index caf71da..ea3f2d2 100644
--- a/aos/events/timing_statistics.cc
+++ b/aos/events/timing_statistics.cc
@@ -4,8 +4,7 @@
 
 #include "aos/events/event_loop_generated.h"
 
-namespace aos {
-namespace internal {
+namespace aos::internal {
 
 void RawFetcherTiming::set_timing_report(timing::Fetcher *new_fetcher) {
   fetcher = new_fetcher;
@@ -74,5 +73,4 @@
   timer->mutate_count(0);
 }
 
-}  // namespace internal
-}  // namespace aos
+}  // namespace aos::internal
diff --git a/aos/events/timing_statistics_test.cc b/aos/events/timing_statistics_test.cc
index 9a7fefc..a8a45eb 100644
--- a/aos/events/timing_statistics_test.cc
+++ b/aos/events/timing_statistics_test.cc
@@ -4,9 +4,7 @@
 
 #include "aos/flatbuffers.h"
 
-namespace aos {
-namespace internal {
-namespace testing {
+namespace aos::internal::testing {
 
 TEST(TimingStatistic, StatisticsTest) {
   flatbuffers::FlatBufferBuilder fbb;
@@ -67,6 +65,4 @@
   EXPECT_NEAR(statistic.message().standard_deviation(), 5.2372293656638, 1e-6);
 }
 
-}  // namespace testing
-}  // namespace internal
-}  // namespace aos
+}  // namespace aos::internal::testing
diff --git a/aos/flatbuffer_introspection_test.cc b/aos/flatbuffer_introspection_test.cc
index a4b09f7..cc7d627 100644
--- a/aos/flatbuffer_introspection_test.cc
+++ b/aos/flatbuffer_introspection_test.cc
@@ -6,8 +6,7 @@
 #include "aos/testing/path.h"
 #include "aos/util/file.h"
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 
 using aos::testing::ArtifactPath;
 
@@ -487,5 +486,4 @@
       "Need to provide a schema");
 }
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/flatbuffer_merge_test.cc b/aos/flatbuffer_merge_test.cc
index 4c59879..a2ac088 100644
--- a/aos/flatbuffer_merge_test.cc
+++ b/aos/flatbuffer_merge_test.cc
@@ -9,8 +9,7 @@
 #include "aos/json_to_flatbuffer.h"
 #include "aos/json_to_flatbuffer_generated.h"
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 
 std::string_view FromFbb(const flatbuffers::FlatBufferBuilder &fbb) {
   return std::string_view(
@@ -589,5 +588,4 @@
 // TODO(austin): unions
 // TODO(austin): struct
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/flatbuffers_test.cc b/aos/flatbuffers_test.cc
index 333d5d7..c4113e9 100644
--- a/aos/flatbuffers_test.cc
+++ b/aos/flatbuffers_test.cc
@@ -7,8 +7,7 @@
 #include "aos/json_to_flatbuffer_generated.h"
 #include "aos/testing/tmpdir.h"
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 
 // Tests that Verify works.
 TEST(FlatbufferTest, Verify) {
@@ -87,5 +86,4 @@
   }
 }
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/ipc_lib/aos_sync.cc b/aos/ipc_lib/aos_sync.cc
index 6bf5d8c..b1a9fb0 100644
--- a/aos/ipc_lib/aos_sync.cc
+++ b/aos/ipc_lib/aos_sync.cc
@@ -1054,9 +1054,7 @@
   return !__atomic_exchange_n(m, 0, __ATOMIC_SEQ_CST);
 }
 
-namespace aos {
-namespace linux_code {
-namespace ipc_lib {
+namespace aos::linux_code::ipc_lib {
 
 // Sets an extra offset between mutexes and the value we use for them in the
 // robust list (only the forward pointers). This is used to work around a kernel
@@ -1070,6 +1068,4 @@
 // This is mainly useful for testing.
 bool HaveLockedMutexes() { return my_robust_list::HaveLockedMutexes(); }
 
-}  // namespace ipc_lib
-}  // namespace linux_code
-}  // namespace aos
+}  // namespace aos::linux_code::ipc_lib
diff --git a/aos/ipc_lib/event_test.cc b/aos/ipc_lib/event_test.cc
index 40c48b2..eda9156 100644
--- a/aos/ipc_lib/event_test.cc
+++ b/aos/ipc_lib/event_test.cc
@@ -8,8 +8,7 @@
 #include "aos/testing/test_logging.h"
 #include "aos/time/time.h"
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 
 namespace chrono = ::std::chrono;
 namespace this_thread = ::std::this_thread;
@@ -89,5 +88,4 @@
   EXPECT_GE(finish_time - start_time, kWaitTime);
 }
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/ipc_lib/index.cc b/aos/ipc_lib/index.cc
index 4701f51..b6796b6 100644
--- a/aos/ipc_lib/index.cc
+++ b/aos/ipc_lib/index.cc
@@ -3,8 +3,7 @@
 #include <sstream>
 #include <string>
 
-namespace aos {
-namespace ipc_lib {
+namespace aos::ipc_lib {
 
 ::std::string QueueIndex::DebugString() const {
   if (valid()) {
@@ -29,5 +28,4 @@
   }
 }
 
-}  // namespace ipc_lib
-}  // namespace aos
+}  // namespace aos::ipc_lib
diff --git a/aos/ipc_lib/index_test.cc b/aos/ipc_lib/index_test.cc
index dca75a0..8e0da6d 100644
--- a/aos/ipc_lib/index_test.cc
+++ b/aos/ipc_lib/index_test.cc
@@ -3,9 +3,7 @@
 #include "glog/logging.h"
 #include "gtest/gtest.h"
 
-namespace aos {
-namespace ipc_lib {
-namespace testing {
+namespace aos::ipc_lib::testing {
 
 class QueueIndexTest : public ::testing::Test {
  protected:
@@ -204,6 +202,4 @@
 #endif
 }
 
-}  // namespace testing
-}  // namespace ipc_lib
-}  // namespace aos
+}  // namespace aos::ipc_lib::testing
diff --git a/aos/ipc_lib/lockless_queue.cc b/aos/ipc_lib/lockless_queue.cc
index f033e60..a26b564 100644
--- a/aos/ipc_lib/lockless_queue.cc
+++ b/aos/ipc_lib/lockless_queue.cc
@@ -22,8 +22,7 @@
 DEFINE_bool(dump_lockless_queue_data, false,
             "If true, print the data out when dumping the queue.");
 
-namespace aos {
-namespace ipc_lib {
+namespace aos::ipc_lib {
 namespace {
 
 class GrabQueueSetupLockOrDie {
@@ -1662,5 +1661,4 @@
   ::std::cout << "}" << ::std::endl;
 }
 
-}  // namespace ipc_lib
-}  // namespace aos
+}  // namespace aos::ipc_lib
diff --git a/aos/ipc_lib/lockless_queue_death_test.cc b/aos/ipc_lib/lockless_queue_death_test.cc
index 92ad8a8..ccf95f7 100644
--- a/aos/ipc_lib/lockless_queue_death_test.cc
+++ b/aos/ipc_lib/lockless_queue_death_test.cc
@@ -27,9 +27,7 @@
 #include "aos/realtime.h"
 #include "aos/testing/test_logging.h"
 
-namespace aos {
-namespace ipc_lib {
-namespace testing {
+namespace aos::ipc_lib::testing {
 
 namespace chrono = ::std::chrono;
 
@@ -216,6 +214,4 @@
 
 #endif
 
-}  // namespace testing
-}  // namespace ipc_lib
-}  // namespace aos
+}  // namespace aos::ipc_lib::testing
diff --git a/aos/ipc_lib/lockless_queue_test.cc b/aos/ipc_lib/lockless_queue_test.cc
index 5b57aa9..bfd9916 100644
--- a/aos/ipc_lib/lockless_queue_test.cc
+++ b/aos/ipc_lib/lockless_queue_test.cc
@@ -39,9 +39,7 @@
 #endif
              "Number of threads to race");
 
-namespace aos {
-namespace ipc_lib {
-namespace testing {
+namespace aos::ipc_lib::testing {
 
 namespace chrono = ::std::chrono;
 
@@ -566,6 +564,4 @@
 
 #endif
 
-}  // namespace testing
-}  // namespace ipc_lib
-}  // namespace aos
+}  // namespace aos::ipc_lib::testing
diff --git a/aos/ipc_lib/memory_mapped_queue.cc b/aos/ipc_lib/memory_mapped_queue.cc
index 594febb..d73b850 100644
--- a/aos/ipc_lib/memory_mapped_queue.cc
+++ b/aos/ipc_lib/memory_mapped_queue.cc
@@ -6,8 +6,7 @@
 
 #include "absl/strings/str_cat.h"
 
-namespace aos {
-namespace ipc_lib {
+namespace aos::ipc_lib {
 
 std::string ShmFolder(std::string_view shm_base, const Channel *channel) {
   CHECK(channel->has_name());
@@ -140,5 +139,4 @@
   PCHECK(munmap(const_cast<void *>(const_data_), size_) == 0);
 }
 
-}  // namespace ipc_lib
-}  // namespace aos
+}  // namespace aos::ipc_lib
diff --git a/aos/ipc_lib/queue_racer.cc b/aos/ipc_lib/queue_racer.cc
index 27f3835..aa73f2b 100644
--- a/aos/ipc_lib/queue_racer.cc
+++ b/aos/ipc_lib/queue_racer.cc
@@ -8,8 +8,7 @@
 
 #include "aos/ipc_lib/event.h"
 
-namespace aos {
-namespace ipc_lib {
+namespace aos::ipc_lib {
 namespace {
 
 struct ThreadPlusCount {
@@ -428,5 +427,4 @@
   }
 }
 
-}  // namespace ipc_lib
-}  // namespace aos
+}  // namespace aos::ipc_lib
diff --git a/aos/ipc_lib/robust_ownership_tracker.cc b/aos/ipc_lib/robust_ownership_tracker.cc
index f106113..13edebc 100644
--- a/aos/ipc_lib/robust_ownership_tracker.cc
+++ b/aos/ipc_lib/robust_ownership_tracker.cc
@@ -2,8 +2,7 @@
 
 #include "aos/ipc_lib/lockless_queue.h"
 
-namespace aos {
-namespace ipc_lib {
+namespace aos::ipc_lib {
 
 ::std::string RobustOwnershipTracker::DebugString() const {
   ::std::stringstream s;
@@ -21,5 +20,4 @@
   return s.str();
 }
 
-}  // namespace ipc_lib
-}  // namespace aos
+}  // namespace aos::ipc_lib
diff --git a/aos/ipc_lib/shm_observers.cc b/aos/ipc_lib/shm_observers.cc
index 04a6214..2f28e46 100644
--- a/aos/ipc_lib/shm_observers.cc
+++ b/aos/ipc_lib/shm_observers.cc
@@ -1,8 +1,6 @@
 #include "aos/ipc_lib/shm_observers.h"
 
-namespace aos {
-namespace linux_code {
-namespace ipc_lib {
+namespace aos::linux_code::ipc_lib {
 
 ShmAccessorObserver before_observer = nullptr, after_observer = nullptr;
 
@@ -12,6 +10,4 @@
   after_observer = after;
 }
 
-}  // namespace ipc_lib
-}  // namespace linux_code
-}  // namespace aos
+}  // namespace aos::linux_code::ipc_lib
diff --git a/aos/ipc_lib/signalfd.cc b/aos/ipc_lib/signalfd.cc
index f23d0be..d25151d 100644
--- a/aos/ipc_lib/signalfd.cc
+++ b/aos/ipc_lib/signalfd.cc
@@ -12,8 +12,7 @@
 
 #include "glog/logging.h"
 
-namespace aos {
-namespace ipc_lib {
+namespace aos::ipc_lib {
 namespace {
 
 // Wrapper which propagates msan information.
@@ -118,5 +117,4 @@
   return result;
 }
 
-}  // namespace ipc_lib
-}  // namespace aos
+}  // namespace aos::ipc_lib
diff --git a/aos/ipc_lib/signalfd_test.cc b/aos/ipc_lib/signalfd_test.cc
index 40c0a13..2f349c1 100644
--- a/aos/ipc_lib/signalfd_test.cc
+++ b/aos/ipc_lib/signalfd_test.cc
@@ -5,9 +5,7 @@
 
 #include "aos/testing/test_logging.h"
 
-namespace aos {
-namespace ipc_lib {
-namespace testing {
+namespace aos::ipc_lib::testing {
 
 // Tests in this file use separate threads to isolate all manipulation of signal
 // masks between test cases.
@@ -72,6 +70,4 @@
                "Some other code unblocked one or more of our signals");
 }
 
-}  // namespace testing
-}  // namespace ipc_lib
-}  // namespace aos
+}  // namespace aos::ipc_lib::testing
diff --git a/aos/json_to_flatbuffer_test.cc b/aos/json_to_flatbuffer_test.cc
index 4900711..85e21d4 100644
--- a/aos/json_to_flatbuffer_test.cc
+++ b/aos/json_to_flatbuffer_test.cc
@@ -7,8 +7,7 @@
 #include "aos/json_to_flatbuffer_generated.h"
 #include "aos/testing/path.h"
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 
 class JsonToFlatbufferTest : public ::testing::Test {
  public:
@@ -402,5 +401,4 @@
           ArtifactPath("aos/json_to_flatbuffer_test_spaces.json"))));
 }
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/libc/aos_strerror_test.cc b/aos/libc/aos_strerror_test.cc
index abd867e..06a012a 100644
--- a/aos/libc/aos_strerror_test.cc
+++ b/aos/libc/aos_strerror_test.cc
@@ -4,9 +4,7 @@
 
 #include "gtest/gtest.h"
 
-namespace aos {
-namespace libc {
-namespace testing {
+namespace aos::libc::testing {
 
 // Tries a couple of easy ones.
 TEST(StrerrorTest, Basic) {
@@ -24,6 +22,4 @@
   }
 }
 
-}  // namespace testing
-}  // namespace libc
-}  // namespace aos
+}  // namespace aos::libc::testing
diff --git a/aos/libc/aos_strsignal_test.cc b/aos/libc/aos_strsignal_test.cc
index d854aab..7e91d46 100644
--- a/aos/libc/aos_strsignal_test.cc
+++ b/aos/libc/aos_strsignal_test.cc
@@ -5,9 +5,7 @@
 
 #include "gtest/gtest.h"
 
-namespace aos {
-namespace libc {
-namespace testing {
+namespace aos::libc::testing {
 
 // Tries a couple of easy ones.
 TEST(StrsignalTest, Basic) {
@@ -45,6 +43,4 @@
 }
 #endif
 
-}  // namespace testing
-}  // namespace libc
-}  // namespace aos
+}  // namespace aos::libc::testing
diff --git a/aos/libc/dirname.cc b/aos/libc/dirname.cc
index bc34496..e73030c 100644
--- a/aos/libc/dirname.cc
+++ b/aos/libc/dirname.cc
@@ -1,7 +1,6 @@
 #include "aos/libc/dirname.h"
 
-namespace aos {
-namespace libc {
+namespace aos::libc {
 namespace {
 
 ::std::string DoDirname(const ::std::string &path, size_t last_slash) {
@@ -35,5 +34,4 @@
   return DoDirname(path, last_slash);
 }
 
-}  // namespace libc
-}  // namespace aos
+}  // namespace aos::libc
diff --git a/aos/libc/dirname_test.cc b/aos/libc/dirname_test.cc
index d003936..501b752 100644
--- a/aos/libc/dirname_test.cc
+++ b/aos/libc/dirname_test.cc
@@ -4,9 +4,7 @@
 
 #include "gtest/gtest.h"
 
-namespace aos {
-namespace libc {
-namespace testing {
+namespace aos::libc::testing {
 
 // Tests the examples from the Linux man-pages release 3.44 dirname(3).
 TEST(DirnameTest, ManPageExamples) {
@@ -74,6 +72,4 @@
   }
 }
 
-}  // namespace testing
-}  // namespace libc
-}  // namespace aos
+}  // namespace aos::libc::testing
diff --git a/aos/logging/context.cc b/aos/logging/context.cc
index d1a6b03..5e5d53c 100644
--- a/aos/logging/context.cc
+++ b/aos/logging/context.cc
@@ -22,9 +22,7 @@
 
 #include "aos/logging/implementations.h"
 
-namespace aos {
-namespace logging {
-namespace internal {
+namespace aos::logging::internal {
 namespace {
 
 // TODO(brians): Differentiate between threads with the same name in the same
@@ -114,6 +112,4 @@
   delete_current_context = false;
 }
 
-}  // namespace internal
-}  // namespace logging
-}  // namespace aos
+}  // namespace aos::logging::internal
diff --git a/aos/logging/dynamic_logging.cc b/aos/logging/dynamic_logging.cc
index 1120a94..a3461b5 100644
--- a/aos/logging/dynamic_logging.cc
+++ b/aos/logging/dynamic_logging.cc
@@ -2,8 +2,7 @@
 
 #include "glog/logging.h"
 
-namespace aos {
-namespace logging {
+namespace aos::logging {
 
 DynamicLogging::DynamicLogging(aos::EventLoop *event_loop)
     : application_name_(event_loop->name()) {
@@ -31,5 +30,4 @@
   FLAGS_v = command.vlog_level();
 }
 
-}  // namespace logging
-}  // namespace aos
+}  // namespace aos::logging
diff --git a/aos/logging/dynamic_logging_test.cc b/aos/logging/dynamic_logging_test.cc
index 9b78113..70e491d 100644
--- a/aos/logging/dynamic_logging_test.cc
+++ b/aos/logging/dynamic_logging_test.cc
@@ -11,9 +11,7 @@
 
 using aos::testing::ArtifactPath;
 
-namespace aos {
-namespace logging {
-namespace testing {
+namespace aos::logging::testing {
 
 namespace chrono = std::chrono;
 
@@ -90,6 +88,4 @@
   }
 }
 
-}  // namespace testing
-}  // namespace logging
-}  // namespace aos
+}  // namespace aos::logging::testing
diff --git a/aos/logging/implementations.cc b/aos/logging/implementations.cc
index 3b4f905..da9e72b 100644
--- a/aos/logging/implementations.cc
+++ b/aos/logging/implementations.cc
@@ -8,8 +8,7 @@
 #include "aos/logging/printf_formats.h"
 #include "aos/time/time.h"
 
-namespace aos {
-namespace logging {
+namespace aos::logging {
 namespace internal {
 namespace {
 
@@ -83,5 +82,4 @@
   return context->implementation;
 }
 
-}  // namespace logging
-}  // namespace aos
+}  // namespace aos::logging
diff --git a/aos/logging/implementations_test.cc b/aos/logging/implementations_test.cc
index d08f85f..693a91e 100644
--- a/aos/logging/implementations_test.cc
+++ b/aos/logging/implementations_test.cc
@@ -14,9 +14,7 @@
 using ::testing::AssertionResult;
 using ::testing::AssertionSuccess;
 
-namespace aos {
-namespace logging {
-namespace testing {
+namespace aos::logging::testing {
 
 namespace chrono = ::std::chrono;
 
@@ -241,6 +239,4 @@
   ASSERT_EQ(curr_impl, GetImplementation().get());
 }
 
-}  // namespace testing
-}  // namespace logging
-}  // namespace aos
+}  // namespace aos::logging::testing
diff --git a/aos/logging/interface.cc b/aos/logging/interface.cc
index 233357d..e0ce6a8 100644
--- a/aos/logging/interface.cc
+++ b/aos/logging/interface.cc
@@ -12,8 +12,7 @@
 #include "aos/logging/context.h"
 #include "aos/logging/implementations.h"
 
-namespace aos {
-namespace logging {
+namespace aos::logging {
 namespace internal {
 
 size_t ExecuteFormat(char *output, size_t output_size, const char *format,
@@ -62,8 +61,7 @@
   }
 }
 
-}  // namespace logging
-}  // namespace aos
+}  // namespace aos::logging
 
 void log_do(log_level level, const char *format, ...) {
   va_list ap;
diff --git a/aos/logging/log_namer.cc b/aos/logging/log_namer.cc
index 4e9e00e..16ba0f2 100644
--- a/aos/logging/log_namer.cc
+++ b/aos/logging/log_namer.cc
@@ -33,8 +33,7 @@
               "The folder to log to.  If empty, search for the /media/sd*1/ "
               "folder and place logs there.");
 
-namespace aos {
-namespace logging {
+namespace aos::logging {
 namespace {
 void AllocateLogName(char **filename, const char *directory,
                      const char *basename) {
@@ -187,5 +186,4 @@
   return log_base_name.value();
 }
 
-}  // namespace logging
-}  // namespace aos
+}  // namespace aos::logging
diff --git a/aos/mutex/mutex_test.cc b/aos/mutex/mutex_test.cc
index ea57362..54e9201 100644
--- a/aos/mutex/mutex_test.cc
+++ b/aos/mutex/mutex_test.cc
@@ -17,8 +17,7 @@
 #include "aos/time/time.h"
 #include "aos/util/death_test_log_implementation.h"
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 
 namespace chrono = ::std::chrono;
 namespace this_thread = ::std::this_thread;
@@ -322,5 +321,4 @@
   mutex->~Mutex();
 }
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/network/message_bridge_client.cc b/aos/network/message_bridge_client.cc
index ef727eb..4a1992a 100644
--- a/aos/network/message_bridge_client.cc
+++ b/aos/network/message_bridge_client.cc
@@ -12,8 +12,7 @@
     wants_sctp_authentication, false,
     "When set, try to use SCTP authentication if provided by the kernel");
 
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
 
 using ::aos::util::ReadFileToVecOrDie;
 
@@ -42,8 +41,7 @@
   return EXIT_SUCCESS;
 }
 
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge
 
 int main(int argc, char **argv) {
   aos::InitGoogle(&argc, &argv);
diff --git a/aos/network/message_bridge_client_lib.cc b/aos/network/message_bridge_client_lib.cc
index bb233a9..620a069 100644
--- a/aos/network/message_bridge_client_lib.cc
+++ b/aos/network/message_bridge_client_lib.cc
@@ -34,8 +34,7 @@
 // To restore it, run:
 //   tc qdisc del dev eth0 root netem
 
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
 namespace {
 namespace chrono = std::chrono;
 
@@ -541,5 +540,4 @@
   sender.CheckOk(sender.Send(builder.Finish()));
 }
 
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge
diff --git a/aos/network/message_bridge_client_status.cc b/aos/network/message_bridge_client_status.cc
index 272e49e..9ca8418 100644
--- a/aos/network/message_bridge_client_status.cc
+++ b/aos/network/message_bridge_client_status.cc
@@ -7,8 +7,7 @@
 #include "aos/events/event_loop.h"
 #include "aos/network/message_bridge_client_generated.h"
 
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
 namespace {
 namespace chrono = std::chrono;
 
@@ -240,5 +239,4 @@
                               kStatisticsPeriod);
 }
 
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge
diff --git a/aos/network/message_bridge_protocol.cc b/aos/network/message_bridge_protocol.cc
index c661c4c..c527957 100644
--- a/aos/network/message_bridge_protocol.cc
+++ b/aos/network/message_bridge_protocol.cc
@@ -9,8 +9,7 @@
 #include "aos/flatbuffers.h"
 #include "aos/network/connect_generated.h"
 
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
 
 aos::FlatbufferDetachedBuffer<aos::message_bridge::Connect> MakeConnectMessage(
     const Configuration *config, const Node *my_node,
@@ -66,5 +65,4 @@
   return fbb.Release();
 }
 
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge
diff --git a/aos/network/message_bridge_retry_test.cc b/aos/network/message_bridge_retry_test.cc
index 4110a76..8229c99 100644
--- a/aos/network/message_bridge_retry_test.cc
+++ b/aos/network/message_bridge_retry_test.cc
@@ -18,10 +18,7 @@
 
 DECLARE_int32(force_wmem_max);
 
-namespace aos {
-
-namespace message_bridge {
-namespace testing {
+namespace aos::message_bridge::testing {
 
 void SendPing(aos::Sender<examples::Ping> *sender, int value) {
   aos::Sender<examples::Ping>::Builder builder = sender->MakeBuilder();
@@ -136,6 +133,4 @@
                          ::testing::Values(Param{
                              "message_bridge_test_common_config.json", false}));
 
-}  // namespace testing
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge::testing
diff --git a/aos/network/message_bridge_server.cc b/aos/network/message_bridge_server.cc
index be6cc8e..64c57f5 100644
--- a/aos/network/message_bridge_server.cc
+++ b/aos/network/message_bridge_server.cc
@@ -14,8 +14,7 @@
     wants_sctp_authentication, false,
     "When set, try to use SCTP authentication if provided by the kernel");
 
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
 
 using ::aos::util::ReadFileToVecOrDie;
 
@@ -43,8 +42,7 @@
   return EXIT_SUCCESS;
 }
 
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge
 
 int main(int argc, char **argv) {
   aos::InitGoogle(&argc, &argv);
diff --git a/aos/network/message_bridge_server_lib.cc b/aos/network/message_bridge_server_lib.cc
index 4f582e7..a2df830 100644
--- a/aos/network/message_bridge_server_lib.cc
+++ b/aos/network/message_bridge_server_lib.cc
@@ -57,8 +57,7 @@
 
 DECLARE_bool(use_sctp_authentication);
 
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
 namespace chrono = std::chrono;
 
 // How often we should poll for the active SCTP authentication key.
@@ -862,5 +861,4 @@
   sender.CheckOk(sender.Send(builder.Finish()));
 }
 
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge
diff --git a/aos/network/message_bridge_server_status.cc b/aos/network/message_bridge_server_status.cc
index f540b1e..0e8c6b0 100644
--- a/aos/network/message_bridge_server_status.cc
+++ b/aos/network/message_bridge_server_status.cc
@@ -12,8 +12,7 @@
 #include "aos/network/timestamp_filter.h"
 #include "aos/network/timestamp_generated.h"
 
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
 namespace {
 
 namespace chrono = std::chrono;
@@ -507,5 +506,4 @@
                               kPingPeriod);
 }
 
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge
diff --git a/aos/network/message_bridge_test.cc b/aos/network/message_bridge_test.cc
index cc46926..c211c89 100644
--- a/aos/network/message_bridge_test.cc
+++ b/aos/network/message_bridge_test.cc
@@ -16,10 +16,7 @@
 #include "aos/testing/path.h"
 #include "aos/util/file.h"
 
-namespace aos {
-
-namespace message_bridge {
-namespace testing {
+namespace aos::message_bridge::testing {
 
 // Note: All of these tests spin up ShmEventLoop's in separate threads to allow
 // us to run the "real" message bridge. This requires extra threading and timing
@@ -1440,6 +1437,4 @@
               true},
         Param{"message_bridge_test_common_config.json", false}));
 
-}  // namespace testing
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge::testing
diff --git a/aos/network/message_bridge_test_lib.cc b/aos/network/message_bridge_test_lib.cc
index 16e4a4b..0062bfd 100644
--- a/aos/network/message_bridge_test_lib.cc
+++ b/aos/network/message_bridge_test_lib.cc
@@ -2,8 +2,7 @@
 
 DECLARE_string(boot_uuid);
 
-namespace aos {
-namespace message_bridge::testing {
+namespace aos::message_bridge::testing {
 
 namespace chrono = std::chrono;
 using aos::testing::ArtifactPath;
@@ -286,5 +285,4 @@
   pi2_test_thread.reset();
 }
 
-}  // namespace message_bridge::testing
-}  // namespace aos
+}  // namespace aos::message_bridge::testing
diff --git a/aos/network/multinode_timestamp_filter.cc b/aos/network/multinode_timestamp_filter.cc
index b4ebef4..0a0385e 100644
--- a/aos/network/multinode_timestamp_filter.cc
+++ b/aos/network/multinode_timestamp_filter.cc
@@ -64,8 +64,7 @@
 #define SOLVE_VLOG(solve_number, v) \
   LOG_IF(INFO, SOLVE_VLOG_IS_ON(solve_number, v))
 
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
 namespace {
 namespace chrono = std::chrono;
 using aos::logger::BootDuration;
@@ -3359,5 +3358,4 @@
   }
 }
 
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge
diff --git a/aos/network/multinode_timestamp_filter_test.cc b/aos/network/multinode_timestamp_filter_test.cc
index 9aa76c0..e581a74 100644
--- a/aos/network/multinode_timestamp_filter_test.cc
+++ b/aos/network/multinode_timestamp_filter_test.cc
@@ -10,9 +10,7 @@
 #include "aos/network/testing_time_converter.h"
 #include "aos/network/timestamp_filter.h"
 
-namespace aos {
-namespace message_bridge {
-namespace testing {
+namespace aos::message_bridge::testing {
 
 namespace chrono = std::chrono;
 using aos::monotonic_clock;
@@ -538,6 +536,4 @@
       << derivatives.df_slope_limited;
 }
 
-}  // namespace testing
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge::testing
diff --git a/aos/network/rawrtc.cc b/aos/network/rawrtc.cc
index db4de07..e519b2e 100644
--- a/aos/network/rawrtc.cc
+++ b/aos/network/rawrtc.cc
@@ -17,8 +17,7 @@
 DEFINE_int32(max_ice_port, -1,
              "Maximum port number to use for ICE candidates.");
 
-namespace aos {
-namespace web_proxy {
+namespace aos::web_proxy {
 namespace {
 enum {
   TRANSPORT_BUFFER_LENGTH = 1048576,  // 1 MiB
@@ -299,5 +298,4 @@
   }
 }
 
-}  // namespace web_proxy
-}  // namespace aos
+}  // namespace aos::web_proxy
diff --git a/aos/network/sctp_client.cc b/aos/network/sctp_client.cc
index a9567a2..32347fd 100644
--- a/aos/network/sctp_client.cc
+++ b/aos/network/sctp_client.cc
@@ -18,8 +18,7 @@
              "Timeout in milliseconds for retrying the INIT packet when "
              "connecting to the message bridge server");
 
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
 
 SctpClient::SctpClient(std::string_view remote_host, int remote_port,
                        int streams, std::string_view local_host, int local_port,
@@ -67,5 +66,4 @@
 #endif
 }
 
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge
diff --git a/aos/network/sctp_lib.cc b/aos/network/sctp_lib.cc
index 99a7f09..829ae67 100644
--- a/aos/network/sctp_lib.cc
+++ b/aos/network/sctp_lib.cc
@@ -26,8 +26,7 @@
 DEFINE_bool(disable_ipv6, false, "disable ipv6");
 DEFINE_int32(rmem, 0, "If nonzero, set rmem to this size.");
 
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
 
 namespace {
 const char *sac_state_tbl[] = {"COMMUNICATION_UP", "COMMUNICATION_LOST",
@@ -788,5 +787,4 @@
   }
 }
 
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge
diff --git a/aos/network/sctp_server.cc b/aos/network/sctp_server.cc
index f4dba39..7f7a0ae 100644
--- a/aos/network/sctp_server.cc
+++ b/aos/network/sctp_server.cc
@@ -18,8 +18,7 @@
 #include "aos/network/sctp_lib.h"
 #include "aos/unique_malloc_ptr.h"
 
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
 
 SctpServer::SctpServer(int streams, std::string_view local_host, int local_port,
                        SctpAuthMethod requested_authentication)
@@ -109,5 +108,4 @@
 #endif
 }
 
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge
diff --git a/aos/network/team_number.cc b/aos/network/team_number.cc
index 8885b52..28ee67a 100644
--- a/aos/network/team_number.cc
+++ b/aos/network/team_number.cc
@@ -13,8 +13,7 @@
     "If set, this forces the hostname of this node to be the provided "
     "hostname.");
 
-namespace aos {
-namespace network {
+namespace aos::network {
 namespace team_number_internal {
 
 std::optional<uint16_t> ParseRoborioTeamNumber(
@@ -150,5 +149,4 @@
   return number;
 }
 
-}  // namespace network
-}  // namespace aos
+}  // namespace aos::network
diff --git a/aos/network/team_number_test.cc b/aos/network/team_number_test.cc
index 68727e2..1ca3fc2 100644
--- a/aos/network/team_number_test.cc
+++ b/aos/network/team_number_test.cc
@@ -2,9 +2,7 @@
 
 #include "gtest/gtest.h"
 
-namespace aos {
-namespace network {
-namespace testing {
+namespace aos::network::testing {
 
 using team_number_internal::ParsePiTeamNumber;
 using team_number_internal::ParseRoborioTeamNumber;
@@ -49,6 +47,4 @@
   EXPECT_FALSE(ParsePiNumber("pi-971"));
 }
 
-}  // namespace testing
-}  // namespace network
-}  // namespace aos
+}  // namespace aos::network::testing
diff --git a/aos/network/testing_time_converter.cc b/aos/network/testing_time_converter.cc
index 9dc5fff..255826e 100644
--- a/aos/network/testing_time_converter.cc
+++ b/aos/network/testing_time_converter.cc
@@ -9,8 +9,7 @@
 #include "aos/network/multinode_timestamp_filter.h"
 #include "aos/time/time.h"
 
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
 
 namespace chrono = std::chrono;
 
@@ -125,5 +124,4 @@
   return result;
 }
 
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge
diff --git a/aos/network/timestamp_channel.cc b/aos/network/timestamp_channel.cc
index 52032f5..778c2e7 100644
--- a/aos/network/timestamp_channel.cc
+++ b/aos/network/timestamp_channel.cc
@@ -10,8 +10,7 @@
             "channels are configured to have at least as great a frequency as "
             "the corresponding data channel.");
 
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
 
 ChannelTimestampFinder::ChannelTimestampFinder(
     const Configuration *configuration, const std::string_view name,
@@ -143,5 +142,4 @@
   return result.first->second.get();
 }
 
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge
diff --git a/aos/network/timestamp_filter.cc b/aos/network/timestamp_filter.cc
index 9736679..914f993 100644
--- a/aos/network/timestamp_filter.cc
+++ b/aos/network/timestamp_filter.cc
@@ -11,8 +11,7 @@
 #include "aos/configuration.h"
 #include "aos/time/time.h"
 
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
 namespace {
 namespace chrono = std::chrono;
 using logger::BootDuration;
@@ -1786,5 +1785,4 @@
   }
 }
 
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge
diff --git a/aos/network/timestamp_filter_test.cc b/aos/network/timestamp_filter_test.cc
index 07f7d6d..f3b7290 100644
--- a/aos/network/timestamp_filter_test.cc
+++ b/aos/network/timestamp_filter_test.cc
@@ -9,9 +9,7 @@
 #include "aos/json_to_flatbuffer.h"
 #include "aos/macros.h"
 
-namespace aos {
-namespace message_bridge {
-namespace testing {
+namespace aos::message_bridge::testing {
 
 namespace chrono = std::chrono;
 using aos::monotonic_clock;
@@ -1673,6 +1671,4 @@
   EXPECT_EQ(estimator.GetFilter(node_b)->timestamps_size(), 2u);
 }
 
-}  // namespace testing
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge::testing
diff --git a/aos/network/web_proxy.cc b/aos/network/web_proxy.cc
index d48d700..15ebb66 100644
--- a/aos/network/web_proxy.cc
+++ b/aos/network/web_proxy.cc
@@ -34,8 +34,7 @@
               "If we have not received any ack's in this amount of time, we "
               "start to continue sending messages.");
 
-namespace aos {
-namespace web_proxy {
+namespace aos::web_proxy {
 WebsocketHandler::WebsocketHandler(::seasocks::Server *server,
                                    aos::EventLoop *event_loop,
                                    StoreHistory store_history,
@@ -699,5 +698,4 @@
   }
 }
 
-}  // namespace web_proxy
-}  // namespace aos
+}  // namespace aos::web_proxy
diff --git a/aos/network/web_proxy_utils.cc b/aos/network/web_proxy_utils.cc
index d6148d4..f4468ab 100644
--- a/aos/network/web_proxy_utils.cc
+++ b/aos/network/web_proxy_utils.cc
@@ -1,7 +1,6 @@
 #include "aos/network/web_proxy_utils.h"
 
-namespace aos {
-namespace web_proxy {
+namespace aos::web_proxy {
 
 namespace {
 // Recommended max size is 64KiB for compatibility reasons. 256KiB theoretically
@@ -98,5 +97,4 @@
   return buffers;
 }
 
-}  // namespace web_proxy
-}  // namespace aos
+}  // namespace aos::web_proxy
diff --git a/aos/realtime.cc b/aos/realtime.cc
index 22b864e..72daa6b 100644
--- a/aos/realtime.cc
+++ b/aos/realtime.cc
@@ -53,14 +53,13 @@
     FLAGS_tcmalloc_release_rate;
 
 namespace aos {
-namespace logging {
-namespace internal {
+
+namespace logging::internal {
 
 // Implemented in aos/logging/context.cc.
 void ReloadThreadName() __attribute__((weak));
 
-}  // namespace internal
-}  // namespace logging
+}  // namespace logging::internal
 
 namespace {
 
diff --git a/aos/realtime_test.cc b/aos/realtime_test.cc
index 97f21c8..348489b 100644
--- a/aos/realtime_test.cc
+++ b/aos/realtime_test.cc
@@ -8,8 +8,7 @@
 
 DECLARE_bool(die_on_malloc);
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 
 // Tests that ScopedRealtime handles the simple case.
 TEST(RealtimeTest, ScopedRealtime) {
@@ -133,8 +132,7 @@
 
 #endif
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
 
 // We need a special gtest main to force die_on_malloc support on.  Otherwise
 // we can't test CHECK statements before turning die_on_malloc on globally.
diff --git a/aos/seasocks/seasocks_logger.cc b/aos/seasocks/seasocks_logger.cc
index 440a3ba..a9d83bc 100644
--- a/aos/seasocks/seasocks_logger.cc
+++ b/aos/seasocks/seasocks_logger.cc
@@ -4,8 +4,7 @@
 
 #include "seasocks/PrintfLogger.h"
 
-namespace aos {
-namespace seasocks {
+namespace aos::seasocks {
 
 void SeasocksLogger::log(::seasocks::Logger::Level level, const char *message) {
   // Convert Seasocks error codes to glog.
@@ -33,5 +32,4 @@
   LOG_AT_LEVEL(glog_level) << "Seasocks: " << message;
 }
 
-}  // namespace seasocks
-}  // namespace aos
+}  // namespace aos::seasocks
diff --git a/aos/starter/mock_starter.cc b/aos/starter/mock_starter.cc
index 9f9a2b5..541e17f 100644
--- a/aos/starter/mock_starter.cc
+++ b/aos/starter/mock_starter.cc
@@ -1,7 +1,6 @@
 #include "aos/starter/mock_starter.h"
 
-namespace aos {
-namespace starter {
+namespace aos::starter {
 
 MockStarter::MockStarter(aos::EventLoop *event_loop)
     : event_loop_(event_loop),
@@ -119,5 +118,4 @@
   }
 }
 
-}  // namespace starter
-}  // namespace aos
+}  // namespace aos::starter
diff --git a/aos/starter/starter_rpc_lib.cc b/aos/starter/starter_rpc_lib.cc
index 4e9ceef..891355e 100644
--- a/aos/starter/starter_rpc_lib.cc
+++ b/aos/starter/starter_rpc_lib.cc
@@ -6,8 +6,7 @@
 #include "aos/flatbuffer_merge.h"
 #include "aos/starter/starterd_lib.h"
 
-namespace aos {
-namespace starter {
+namespace aos::starter {
 
 namespace {
 State ExpectedStateForCommand(Command command) {
@@ -307,5 +306,4 @@
                    status_fetcher.CopyFlatBuffer()));
 }
 
-}  // namespace starter
-}  // namespace aos
+}  // namespace aos::starter
diff --git a/aos/starter/starter_test.cc b/aos/starter/starter_test.cc
index e68cf05..d26f414 100644
--- a/aos/starter/starter_test.cc
+++ b/aos/starter/starter_test.cc
@@ -17,8 +17,7 @@
 
 using aos::testing::ArtifactPath;
 
-namespace aos {
-namespace starter {
+namespace aos::starter {
 
 class ThreadedStarterRunner {
  public:
@@ -572,5 +571,4 @@
   ASSERT_FALSE(starter.event_loop()->is_running());
 }
 
-}  // namespace starter
-}  // namespace aos
+}  // namespace aos::starter
diff --git a/aos/starter/starterd_lib.cc b/aos/starter/starterd_lib.cc
index bf0fc31..95210c0 100644
--- a/aos/starter/starterd_lib.cc
+++ b/aos/starter/starterd_lib.cc
@@ -20,8 +20,7 @@
               "Number of threads to spin up to initialize the queue.  0 means "
               "use the main thread.");
 
-namespace aos {
-namespace starter {
+namespace aos::starter {
 
 const aos::Channel *StatusChannelForNode(const aos::Configuration *config,
                                          const aos::Node *node) {
@@ -315,5 +314,4 @@
           << shm_base_;
 }
 
-}  // namespace starter
-}  // namespace aos
+}  // namespace aos::starter
diff --git a/aos/stl_mutex/stl_mutex_test.cc b/aos/stl_mutex/stl_mutex_test.cc
index 5e88c56..5343974 100644
--- a/aos/stl_mutex/stl_mutex_test.cc
+++ b/aos/stl_mutex/stl_mutex_test.cc
@@ -4,8 +4,7 @@
 
 #include "aos/die.h"
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 
 class StlMutexDeathTest : public ::testing::Test {
  protected:
@@ -65,5 +64,4 @@
   EXPECT_DEATH(mutex.unlock(), ".*multiple unlock.*");
 }
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/testing/gtest_main.cc b/aos/testing/gtest_main.cc
index 2fb77fe..6071bde 100644
--- a/aos/testing/gtest_main.cc
+++ b/aos/testing/gtest_main.cc
@@ -14,16 +14,13 @@
 DEFINE_string(log_file, "",
               "Print all log messages to FILE instead of standard output.");
 
-namespace aos {
-
-namespace testing {
+namespace aos::testing {
 
 // Actually declared/defined in //aos/testing:test_logging.
 void SetLogFileName(const char *filename) __attribute__((weak));
 void ForcePrintLogsDuringTests() __attribute__((weak));
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
 
 GTEST_API_ int main(int argc, char **argv) {
   ::testing::InitGoogleTest(&argc, argv);
diff --git a/aos/testing/path.cc b/aos/testing/path.cc
index f63fd97..cb17c73 100644
--- a/aos/testing/path.cc
+++ b/aos/testing/path.cc
@@ -2,8 +2,7 @@
 
 #include "absl/strings/str_cat.h"
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 
 // Returns the path to the provided artifact which works when built both as an
 // external target and in the repo.
@@ -13,5 +12,4 @@
   return absl::StrCat("../org_frc971/", path);
 }
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/testing/prevent_exit.cc b/aos/testing/prevent_exit.cc
index b640fe7..7c8da60 100644
--- a/aos/testing/prevent_exit.cc
+++ b/aos/testing/prevent_exit.cc
@@ -6,8 +6,7 @@
 
 #include "glog/logging.h"
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 namespace {
 
 void TerminateExitHandler() { _exit(EXIT_SUCCESS); }
@@ -16,5 +15,4 @@
 
 void PreventExit() { CHECK_EQ(atexit(TerminateExitHandler), 0); }
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/testing/prevent_exit.h b/aos/testing/prevent_exit.h
index ee39fdb..75e8a1a 100644
--- a/aos/testing/prevent_exit.h
+++ b/aos/testing/prevent_exit.h
@@ -1,8 +1,7 @@
 #ifndef AOS_TESTING_PREVENT_EXIT_H_
 #define AOS_TESTING_PREVENT_EXIT_H_
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 
 // Registers an exit handler (using atexit(3)) which will call _exit(2).
 // Intended to be called in a freshly fork(2)ed process where it will run before
@@ -10,7 +9,6 @@
 // being run.
 void PreventExit();
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
 
 #endif  // AOS_TESTING_PREVENT_EXIT_H_
diff --git a/aos/testing/random_seed.cc b/aos/testing/random_seed.cc
index 8f26d07..302612e 100644
--- a/aos/testing/random_seed.cc
+++ b/aos/testing/random_seed.cc
@@ -2,8 +2,7 @@
 
 #include <cstdlib>
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 
 int RandomSeed() {
   const char *from_environment = getenv("TEST_RANDOM_SEED");
@@ -13,5 +12,4 @@
   return 1;
 }
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/testing/random_seed.h b/aos/testing/random_seed.h
index 825e7b1..11bfe99 100644
--- a/aos/testing/random_seed.h
+++ b/aos/testing/random_seed.h
@@ -1,15 +1,13 @@
 #ifndef AOS_TESTING_RANDOM_SEED_H_
 #define AOS_TESTING_RANDOM_SEED_H_
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 
 // Returns the random seed to use for testing.
 //
 // This is ${TEST_RANDOM_SEED} if it is set or 1.
 int RandomSeed();
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
 
 #endif  // AOS_TESTING_RANDOM_SEED_H_
diff --git a/aos/testing/test_logging.cc b/aos/testing/test_logging.cc
index a2042e2..56875bb 100644
--- a/aos/testing/test_logging.cc
+++ b/aos/testing/test_logging.cc
@@ -11,8 +11,7 @@
 
 using ::aos::logging::LogMessage;
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 namespace {
 
 class TestLogImplementation : public logging::HandleMessageLogImplementation {
@@ -138,5 +137,4 @@
   TestLogImplementation::GetInstance()->PrintMessagesAsTheyComeIn();
 }
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/testing/test_logging_test.cc b/aos/testing/test_logging_test.cc
index f39c6cf..5731545 100644
--- a/aos/testing/test_logging_test.cc
+++ b/aos/testing/test_logging_test.cc
@@ -6,8 +6,7 @@
 
 #include "aos/logging/logging.h"
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 
 // Tests logging from multiple threads.
 // tsan used to complain about this.
@@ -25,5 +24,4 @@
   thread.join();
 }
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/testing/test_shm.cc b/aos/testing/test_shm.cc
index 8dc189a..1b168ea 100644
--- a/aos/testing/test_shm.cc
+++ b/aos/testing/test_shm.cc
@@ -7,8 +7,7 @@
 #include "aos/logging/logging.h"
 #include "aos/testing/test_logging.h"
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 namespace {
 
 const size_t kCoreSize = 0x100000;
@@ -35,5 +34,4 @@
   global_core = NULL;
 }
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/testing/tmpdir.cc b/aos/testing/tmpdir.cc
index 7287603..0953a21 100644
--- a/aos/testing/tmpdir.cc
+++ b/aos/testing/tmpdir.cc
@@ -5,8 +5,7 @@
 
 #include "aos/ipc_lib/shm_base.h"
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 
 namespace {
 std::string TestTmpDirOr(std::string fallback) {
@@ -22,5 +21,4 @@
 
 void SetTestShmBase() { SetShmBase(TestTmpDirOr(FLAGS_shm_base)); }
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/time/time.cc b/aos/time/time.cc
index 6ba9543..6a25aa9 100644
--- a/aos/time/time.cc
+++ b/aos/time/time.cc
@@ -45,8 +45,7 @@
 
 #ifdef __linux__
 
-namespace std {
-namespace this_thread {
+namespace std::this_thread {
 template <>
 void sleep_until(const ::aos::monotonic_clock::time_point &end_time) {
   struct timespec end_time_timespec;
@@ -68,8 +67,7 @@
   } while (returnval != 0);
 }
 
-}  // namespace this_thread
-}  // namespace std
+}  // namespace std::this_thread
 
 #endif  // __linux__
 
diff --git a/aos/time/time_test.cc b/aos/time/time_test.cc
index d5c82f2..63a145b 100644
--- a/aos/time/time_test.cc
+++ b/aos/time/time_test.cc
@@ -8,9 +8,7 @@
 #include "aos/macros.h"
 #include "aos/util/death_test_log_implementation.h"
 
-namespace aos {
-namespace time {
-namespace testing {
+namespace aos::time::testing {
 
 namespace chrono = std::chrono;
 
@@ -226,6 +224,4 @@
   }
 }
 
-}  // namespace testing
-}  // namespace time
-}  // namespace aos
+}  // namespace aos::time::testing
diff --git a/aos/util/bitpacking_test.cc b/aos/util/bitpacking_test.cc
index 087c719..0f534a1 100644
--- a/aos/util/bitpacking_test.cc
+++ b/aos/util/bitpacking_test.cc
@@ -5,8 +5,7 @@
 
 #include "gtest/gtest.h"
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 
 // Tests MaskOnes with small arguments.
 TEST(MaskOnesTest, Small) {
@@ -384,5 +383,4 @@
   EXPECT_EQ(0.75f, (IntToFloatLinear<2>(-1.0f, 1.0f, 3)));
 }
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/util/file.cc b/aos/util/file.cc
index 973ab3c..ef958c6 100644
--- a/aos/util/file.cc
+++ b/aos/util/file.cc
@@ -15,8 +15,7 @@
 
 #include "aos/scoped/scoped_fd.h"
 
-namespace aos {
-namespace util {
+namespace aos::util {
 
 std::string ReadFileToStringOrDie(const std::string_view filename) {
   std::optional<std::string> r = MaybeReadFileToString(filename);
@@ -283,5 +282,4 @@
       << ": Failed to write " << bytes.size() << " bytes.";
 }
 
-}  // namespace util
-}  // namespace aos
+}  // namespace aos::util
diff --git a/aos/util/file_test.cc b/aos/util/file_test.cc
index 905a2cd..b3f1e66 100644
--- a/aos/util/file_test.cc
+++ b/aos/util/file_test.cc
@@ -10,9 +10,7 @@
 #include "aos/realtime.h"
 #include "aos/testing/tmpdir.h"
 
-namespace aos {
-namespace util {
-namespace testing {
+namespace aos::util::testing {
 
 using ::testing::ElementsAre;
 
@@ -144,6 +142,4 @@
   EXPECT_EQ("", ReadFileToStringOrDie(test_file));
 }
 
-}  // namespace testing
-}  // namespace util
-}  // namespace aos
+}  // namespace aos::util::testing
diff --git a/aos/util/math_test.cc b/aos/util/math_test.cc
index a243e53..df68f00 100644
--- a/aos/util/math_test.cc
+++ b/aos/util/math_test.cc
@@ -2,9 +2,7 @@
 
 #include "gtest/gtest.h"
 
-namespace aos {
-namespace math {
-namespace testing {
+namespace aos::math::testing {
 
 bool AngleEqual(double a1, double a2) {
   double diff = a1 - a2;
@@ -84,6 +82,4 @@
   EXPECT_FALSE(PointsAreCCW<double>(c, b, a));
 }
 
-}  // namespace testing
-}  // namespace math
-}  // namespace aos
+}  // namespace aos::math::testing
diff --git a/aos/util/options_test.cc b/aos/util/options_test.cc
index ee228cb..f560fe6 100644
--- a/aos/util/options_test.cc
+++ b/aos/util/options_test.cc
@@ -2,8 +2,7 @@
 
 #include "gtest/gtest.h"
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 
 class OptionsTest : public ::testing::Test {
  public:
@@ -52,5 +51,4 @@
   EXPECT_FALSE(one_three.AllSet(kOne | kTwo | kThree | kFour));
 }
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/util/phased_loop.cc b/aos/util/phased_loop.cc
index 1f61775..476cc3f 100644
--- a/aos/util/phased_loop.cc
+++ b/aos/util/phased_loop.cc
@@ -2,8 +2,7 @@
 
 #include "glog/logging.h"
 
-namespace aos {
-namespace time {
+namespace aos::time {
 
 PhasedLoop::PhasedLoop(const monotonic_clock::duration interval,
                        const monotonic_clock::time_point monotonic_now,
@@ -79,5 +78,4 @@
   return result;
 }
 
-}  // namespace time
-}  // namespace aos
+}  // namespace aos::time
diff --git a/aos/util/phased_loop_test.cc b/aos/util/phased_loop_test.cc
index cfe0107..af33567 100644
--- a/aos/util/phased_loop_test.cc
+++ b/aos/util/phased_loop_test.cc
@@ -5,9 +5,7 @@
 
 #include "aos/time/time.h"
 
-namespace aos {
-namespace time {
-namespace testing {
+namespace aos::time::testing {
 
 using ::std::chrono::milliseconds;
 using ::std::chrono::nanoseconds;
@@ -304,6 +302,4 @@
   EXPECT_EQ(4, loop.Iterate((last_time - kOffset) + (kInterval * 4)));
 }
 
-}  // namespace testing
-}  // namespace time
-}  // namespace aos
+}  // namespace aos::time::testing
diff --git a/aos/util/scoped_pipe_test.cc b/aos/util/scoped_pipe_test.cc
index 0e024c2..80059f8 100644
--- a/aos/util/scoped_pipe_test.cc
+++ b/aos/util/scoped_pipe_test.cc
@@ -7,9 +7,7 @@
 
 #include "gtest/gtest.h"
 
-namespace aos {
-namespace util {
-namespace testing {
+namespace aos::util::testing {
 
 // Tests using uint32_t read/write methods on the ScopedPipe objects.
 TEST(ScopedPipeTest, IntegerPipe) {
@@ -67,6 +65,4 @@
   ASSERT_NE(0, fcntl(pipe.read->fd(), F_GETFD) & FD_CLOEXEC);
 }
 
-}  // namespace testing
-}  // namespace util
-}  // namespace aos
+}  // namespace aos::util::testing
diff --git a/aos/util/threaded_consumer_test.cc b/aos/util/threaded_consumer_test.cc
index 96375f0..36f3121 100644
--- a/aos/util/threaded_consumer_test.cc
+++ b/aos/util/threaded_consumer_test.cc
@@ -2,8 +2,7 @@
 
 #include "gtest/gtest.h"
 
-namespace aos {
-namespace util {
+namespace aos::util {
 
 // We expect it to be able to pass through everything we submit and recieves it
 // in the order that we submitted it. It should also be able to take in more
@@ -140,5 +139,4 @@
   EXPECT_EQ(counter, 1);
 }
 
-}  // namespace util
-}  // namespace aos
+}  // namespace aos::util
diff --git a/aos/util/trapezoid_profile.cc b/aos/util/trapezoid_profile.cc
index e74110f..938ca75 100644
--- a/aos/util/trapezoid_profile.cc
+++ b/aos/util/trapezoid_profile.cc
@@ -4,8 +4,7 @@
 
 using ::Eigen::Matrix;
 
-namespace aos {
-namespace util {
+namespace aos::util {
 
 TrapezoidProfile::TrapezoidProfile(::std::chrono::nanoseconds delta_time)
     : maximum_acceleration_(0), maximum_velocity_(0), timestep_(delta_time) {
@@ -118,5 +117,4 @@
   deceleration_time_ = (goal_velocity - top_velocity) / deceleration_;
 }
 
-}  // namespace util
-}  // namespace aos
+}  // namespace aos::util
diff --git a/aos/util/trapezoid_profile_test.cc b/aos/util/trapezoid_profile_test.cc
index afd64ea..92b9996 100644
--- a/aos/util/trapezoid_profile_test.cc
+++ b/aos/util/trapezoid_profile_test.cc
@@ -3,9 +3,7 @@
 #include "Eigen/Dense"
 #include "gtest/gtest.h"
 
-namespace aos {
-namespace util {
-namespace testing {
+namespace aos::util::testing {
 
 class TrapezoidProfileTest : public ::testing::Test {
  public:
@@ -120,6 +118,4 @@
   EXPECT_EQ(position()(0), 1.0);
 }
 
-}  // namespace testing
-}  // namespace util
-}  // namespace aos
+}  // namespace aos::util::testing
diff --git a/aos/util/wrapping_counter.cc b/aos/util/wrapping_counter.cc
index f98d7e3..ead4781 100644
--- a/aos/util/wrapping_counter.cc
+++ b/aos/util/wrapping_counter.cc
@@ -1,7 +1,6 @@
 #include "aos/util/wrapping_counter.h"
 
-namespace aos {
-namespace util {
+namespace aos::util {
 
 WrappingCounter::WrappingCounter(int32_t initial_count)
     : count_(initial_count), last_count_(0) {}
@@ -15,5 +14,4 @@
   return count_;
 }
 
-}  // namespace util
-}  // namespace aos
+}  // namespace aos::util
diff --git a/aos/util/wrapping_counter_test.cc b/aos/util/wrapping_counter_test.cc
index 3ef503b..17605a0 100644
--- a/aos/util/wrapping_counter_test.cc
+++ b/aos/util/wrapping_counter_test.cc
@@ -4,9 +4,7 @@
 
 #include "gtest/gtest.h"
 
-namespace aos {
-namespace util {
-namespace testing {
+namespace aos::util::testing {
 
 TEST(WrappingCounterTest, Basic) {
   WrappingCounter test_counter;
@@ -53,6 +51,4 @@
   test_wrapping(0, 255);
 }
 
-}  // namespace testing
-}  // namespace util
-}  // namespace aos
+}  // namespace aos::util::testing
diff --git a/aos/uuid_collision_test.cc b/aos/uuid_collision_test.cc
index 05bbccd..99b870b 100644
--- a/aos/uuid_collision_test.cc
+++ b/aos/uuid_collision_test.cc
@@ -6,8 +6,7 @@
 
 #include "aos/uuid.h"
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 
 // Tests that modest numbers of UUID::Random() calls cannot create UUID
 // collisions (to test that we have not *completely* messed up the random number
@@ -40,5 +39,4 @@
     values.insert(value);
   }
 }
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/uuid_test.cc b/aos/uuid_test.cc
index 74e7935..f6ed21e 100644
--- a/aos/uuid_test.cc
+++ b/aos/uuid_test.cc
@@ -3,8 +3,7 @@
 #include "glog/logging.h"
 #include "gtest/gtest.h"
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 
 // Tests that random UUIDs are actually random, and we can convert them to a
 // string.  Not very exhaustive, but it is a good smoke test.
@@ -52,5 +51,4 @@
   EXPECT_EQ(u_span, u2);
 }
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/vision/blob/codec.cc b/aos/vision/blob/codec.cc
index 51ae129..be11281 100644
--- a/aos/vision/blob/codec.cc
+++ b/aos/vision/blob/codec.cc
@@ -1,7 +1,6 @@
 #include "aos/vision/blob/codec.h"
 
-namespace aos {
-namespace vision {
+namespace aos::vision {
 
 size_t CalculateSize(const BlobList &blob_list) {
   size_t count = Int16Codec::kSize;
@@ -55,5 +54,4 @@
   return data;
 }
 
-}  // namespace vision
-}  // namespace aos
+}  // namespace aos::vision
diff --git a/aos/vision/blob/codec_test.cc b/aos/vision/blob/codec_test.cc
index d510e58..889dfbb 100644
--- a/aos/vision/blob/codec_test.cc
+++ b/aos/vision/blob/codec_test.cc
@@ -4,8 +4,7 @@
 
 #include "gtest/gtest.h"
 
-namespace aos {
-namespace vision {
+namespace aos::vision {
 
 TEST(CodecTest, WriteRead) {
   BlobList blobl;
@@ -34,5 +33,4 @@
   EXPECT_EQ(real_len, CalculateSize(blobl));
 }
 
-}  // namespace vision
-}  // namespace aos
+}  // namespace aos::vision
diff --git a/aos/vision/blob/contour.cc b/aos/vision/blob/contour.cc
index 6a56f9e..5e82d4c 100644
--- a/aos/vision/blob/contour.cc
+++ b/aos/vision/blob/contour.cc
@@ -1,7 +1,6 @@
 #include "aos/vision/blob/contour.h"
 
-namespace aos {
-namespace vision {
+namespace aos::vision {
 
 namespace {
 // Half-loop of a contour.
@@ -191,5 +190,4 @@
   return plst[0].st;
 }
 
-}  // namespace vision
-}  // namespace aos
+}  // namespace aos::vision
diff --git a/aos/vision/blob/find_blob.cc b/aos/vision/blob/find_blob.cc
index ab65e34..8ee8e92 100644
--- a/aos/vision/blob/find_blob.cc
+++ b/aos/vision/blob/find_blob.cc
@@ -2,8 +2,7 @@
 
 #include "aos/vision/blob/disjoint_set.h"
 
-namespace aos {
-namespace vision {
+namespace aos::vision {
 
 struct BlobBuilder {
   BlobBuilder(int i) : min_y(i) {}
@@ -173,5 +172,4 @@
   return blob_set.MoveBlobs();
 }
 
-}  // namespace vision
-}  // namespace aos
+}  // namespace aos::vision
diff --git a/aos/vision/blob/hierarchical_contour_merge.cc b/aos/vision/blob/hierarchical_contour_merge.cc
index c7de4de..06c34d4 100644
--- a/aos/vision/blob/hierarchical_contour_merge.cc
+++ b/aos/vision/blob/hierarchical_contour_merge.cc
@@ -5,8 +5,7 @@
 
 #include "aos/vision/blob/disjoint_set.h"
 
-namespace aos {
-namespace vision {
+namespace aos::vision {
 
 namespace {
 
@@ -248,5 +247,4 @@
   }
 }
 
-}  // namespace vision
-}  // namespace aos
+}  // namespace aos::vision
diff --git a/aos/vision/blob/move_scale.cc b/aos/vision/blob/move_scale.cc
index 1caa479..45337fc 100644
--- a/aos/vision/blob/move_scale.cc
+++ b/aos/vision/blob/move_scale.cc
@@ -1,7 +1,6 @@
 #include "aos/vision/blob/move_scale.h"
 
-namespace aos {
-namespace vision {
+namespace aos::vision {
 
 RangeImage MoveScale(const RangeImage &img, int dx, int dy, int scale) {
   std::vector<std::vector<ImageRange>> out_range_list;
@@ -38,5 +37,4 @@
   }
 }
 
-}  // namespace vision
-}  // namespace aos
+}  // namespace aos::vision
diff --git a/aos/vision/blob/range_image.cc b/aos/vision/blob/range_image.cc
index bf8d09f..92f77cc 100644
--- a/aos/vision/blob/range_image.cc
+++ b/aos/vision/blob/range_image.cc
@@ -3,8 +3,7 @@
 #include <algorithm>
 #include <cmath>
 
-namespace aos {
-namespace vision {
+namespace aos::vision {
 namespace {
 
 // Merge sort of multiple range images into a single range image.
@@ -142,5 +141,4 @@
   return area;
 }
 
-}  // namespace vision
-}  // namespace aos
+}  // namespace aos::vision
diff --git a/aos/vision/blob/test_utils.cc b/aos/vision/blob/test_utils.cc
index 7664f8a..0e7240f 100644
--- a/aos/vision/blob/test_utils.cc
+++ b/aos/vision/blob/test_utils.cc
@@ -1,7 +1,6 @@
 #include "aos/vision/blob/test_utils.h"
 
-namespace aos {
-namespace vision {
+namespace aos::vision {
 
 RangeImage LoadFromTestData(int mini, const char *data) {
   // Consume initial return.
@@ -39,5 +38,4 @@
   return RangeImage(mini, std::move(rows));
 }
 
-}  // namespace vision
-}  // namespace aos
+}  // namespace aos::vision
diff --git a/aos/vision/blob/threshold.cc b/aos/vision/blob/threshold.cc
index c4f8a9e..5403bbd 100644
--- a/aos/vision/blob/threshold.cc
+++ b/aos/vision/blob/threshold.cc
@@ -2,8 +2,7 @@
 
 #include "aos/logging/logging.h"
 
-namespace aos {
-namespace vision {
+namespace aos::vision {
 namespace {
 
 constexpr int kChunkSize = 8;
@@ -123,5 +122,4 @@
   }
 }
 
-}  // namespace vision
-}  // namespace aos
+}  // namespace aos::vision
diff --git a/aos/vision/blob/threshold_test.cc b/aos/vision/blob/threshold_test.cc
index 67f7116..4b23f3e 100644
--- a/aos/vision/blob/threshold_test.cc
+++ b/aos/vision/blob/threshold_test.cc
@@ -9,9 +9,7 @@
 #include "aos/vision/blob/range_image.h"
 #include "aos/vision/image/image_types.h"
 
-namespace aos {
-namespace vision {
-namespace testing {
+namespace aos::vision::testing {
 
 class YuyvYThresholdTest : public ::testing::Test {
  public:
@@ -189,6 +187,4 @@
   }
 }
 
-}  // namespace testing
-}  // namespace vision
-}  // namespace aos
+}  // namespace aos::vision::testing
diff --git a/aos/vision/blob/transpose.cc b/aos/vision/blob/transpose.cc
index fe4d4a9..b59e8c5 100644
--- a/aos/vision/blob/transpose.cc
+++ b/aos/vision/blob/transpose.cc
@@ -3,8 +3,7 @@
 #include <algorithm>
 #include <limits>
 
-namespace aos {
-namespace vision {
+namespace aos::vision {
 
 RangeImage Transpose(const RangeImage &img) {
   enum EventT {
@@ -87,5 +86,4 @@
   return RangeImage(min_y, std::move(rows));
 }
 
-}  // namespace vision
-}  // namespace aos
+}  // namespace aos::vision
diff --git a/aos/vision/blob/transpose_test.cc b/aos/vision/blob/transpose_test.cc
index 6582b5d..a4a9705 100644
--- a/aos/vision/blob/transpose_test.cc
+++ b/aos/vision/blob/transpose_test.cc
@@ -7,8 +7,7 @@
 
 #include "aos/vision/blob/test_utils.h"
 
-namespace aos {
-namespace vision {
+namespace aos::vision {
 
 TEST(TransposeTest, Tranpspose) {
   RangeImage img = LoadFromTestData(20, R"(
@@ -27,5 +26,4 @@
   EXPECT_EQ(ShortDebugPrint({img}), ShortDebugPrint({c}));
 }
 
-}  // namespace vision
-}  // namespace aos
+}  // namespace aos::vision
diff --git a/aos/vision/debug/aveugle-source.cc b/aos/vision/debug/aveugle-source.cc
index 65a8e84..46b9694 100644
--- a/aos/vision/debug/aveugle-source.cc
+++ b/aos/vision/debug/aveugle-source.cc
@@ -7,8 +7,7 @@
 #include "aos/vision/image/camera_params.pb.h"
 #include "aos/vision/image/image_stream.h"
 
-namespace aos {
-namespace vision {
+namespace aos::vision {
 
 class AveugleImageSource : public ImageSource {
  public:
@@ -73,5 +72,4 @@
 
 REGISTER_IMAGE_SOURCE("jevois", AveugleImageSource);
 
-}  // namespace vision
-}  // namespace aos
+}  // namespace aos::vision
diff --git a/aos/vision/debug/blob_log-source.cc b/aos/vision/debug/blob_log-source.cc
index 4dd5675..c5ee67c 100644
--- a/aos/vision/debug/blob_log-source.cc
+++ b/aos/vision/debug/blob_log-source.cc
@@ -14,8 +14,7 @@
 #include "aos/vision/debug/debug_framework.h"
 #include "aos/vision/debug/overlay.h"
 
-namespace aos {
-namespace vision {
+namespace aos::vision {
 
 namespace {
 
@@ -365,5 +364,4 @@
 
 REGISTER_IMAGE_SOURCE("blob_log", BlobLogImageSource);
 
-}  // namespace vision
-}  // namespace aos
+}  // namespace aos::vision
diff --git a/aos/vision/debug/camera-source.cc b/aos/vision/debug/camera-source.cc
index 578ebc1..685b7eb 100644
--- a/aos/vision/debug/camera-source.cc
+++ b/aos/vision/debug/camera-source.cc
@@ -7,8 +7,7 @@
 #include "aos/vision/image/camera_params.pb.h"
 #include "aos/vision/image/image_stream.h"
 
-namespace aos {
-namespace vision {
+namespace aos::vision {
 
 class CameraImageSource : public ImageSource {
  public:
@@ -63,5 +62,4 @@
 
 REGISTER_IMAGE_SOURCE("camera", CameraImageSource);
 
-}  // namespace vision
-}  // namespace aos
+}  // namespace aos::vision
diff --git a/aos/vision/debug/debug_framework.cc b/aos/vision/debug/debug_framework.cc
index 0b0d2c7..770eefd 100644
--- a/aos/vision/debug/debug_framework.cc
+++ b/aos/vision/debug/debug_framework.cc
@@ -9,8 +9,7 @@
 #include "aos/vision/events/epoll_events.h"
 #include "aos/vision/image/jpeg_routines.h"
 
-namespace aos {
-namespace vision {
+namespace aos::vision {
 
 // Detect screen height on smaller monitors.
 int GetScreenHeight() {
@@ -176,5 +175,4 @@
   replay.Loop()->RunWithGtkMain();
 }
 
-}  // namespace vision
-}  // namespace aos
+}  // namespace aos::vision
diff --git a/aos/vision/debug/debug_window.cc b/aos/vision/debug/debug_window.cc
index b998c03..40d1468 100644
--- a/aos/vision/debug/debug_window.cc
+++ b/aos/vision/debug/debug_window.cc
@@ -12,8 +12,7 @@
 
 #include "aos/vision/image/image_types.h"
 
-namespace aos {
-namespace vision {
+namespace aos::vision {
 
 template <typename T, gboolean (T::*DrawMethod)(cairo_t *cr)>
 gboolean DrawCallback(GtkWidget *, cairo_t *cr, gpointer data) {
@@ -181,5 +180,4 @@
   cairo_restore(cr_);
 }
 
-}  // namespace vision
-}  // namespace aos
+}  // namespace aos::vision
diff --git a/aos/vision/debug/jpeg_list-source.cc b/aos/vision/debug/jpeg_list-source.cc
index ecc3f14..7c6c9dc 100644
--- a/aos/vision/debug/jpeg_list-source.cc
+++ b/aos/vision/debug/jpeg_list-source.cc
@@ -6,8 +6,7 @@
 #include "aos/vision/debug/debug_framework.h"
 #include "aos/vision/image/image_dataset.h"
 
-namespace aos {
-namespace vision {
+namespace aos::vision {
 
 class JpegListImageSource : public ImageSource {
  public:
@@ -65,5 +64,4 @@
 
 REGISTER_IMAGE_SOURCE("jpeg_list", JpegListImageSource);
 
-}  // namespace vision
-}  // namespace aos
+}  // namespace aos::vision
diff --git a/aos/vision/debug/tcp-source.cc b/aos/vision/debug/tcp-source.cc
index de406ae..7749f5c 100644
--- a/aos/vision/debug/tcp-source.cc
+++ b/aos/vision/debug/tcp-source.cc
@@ -12,8 +12,7 @@
 #include "aos/vision/debug/debug_framework.h"
 #include "aos/vision/events/tcp_client.h"
 
-namespace aos {
-namespace vision {
+namespace aos::vision {
 
 // Reads packets in the form:
 // uint32 length
@@ -152,5 +151,4 @@
 
 REGISTER_IMAGE_SOURCE("tcp", TCPImageSource);
 
-}  // namespace vision
-}  // namespace aos
+}  // namespace aos::vision
diff --git a/aos/vision/events/epoll_events.cc b/aos/vision/events/epoll_events.cc
index e417f0d..1a5ad7e 100644
--- a/aos/vision/events/epoll_events.cc
+++ b/aos/vision/events/epoll_events.cc
@@ -10,8 +10,7 @@
 
 #include "aos/logging/logging.h"
 
-namespace aos {
-namespace events {
+namespace aos::events {
 
 void EpollEvent::DirectEvent(uint32_t events) {
   if ((events & ~(EPOLLIN | EPOLLPRI | EPOLLERR)) != 0) {
@@ -72,5 +71,4 @@
   return r;
 }
 
-}  // namespace events
-}  // namespace aos
+}  // namespace aos::events
diff --git a/aos/vision/events/gtk_event.cc b/aos/vision/events/gtk_event.cc
index e1e4e08..7df0716 100644
--- a/aos/vision/events/gtk_event.cc
+++ b/aos/vision/events/gtk_event.cc
@@ -9,8 +9,7 @@
 #include "aos/logging/logging.h"
 #include "aos/vision/events/epoll_events.h"
 
-namespace aos {
-namespace events {
+namespace aos::events {
 
 void EpollLoop::RunWithGtkMain() {
   int timeout;
@@ -69,5 +68,4 @@
   exit(EXIT_SUCCESS);
 }
 
-}  // namespace events
-}  // namespace aos
+}  // namespace aos::events
diff --git a/aos/vision/events/intrusive_free_list.h b/aos/vision/events/intrusive_free_list.h
index 0373741..db096b7 100644
--- a/aos/vision/events/intrusive_free_list.h
+++ b/aos/vision/events/intrusive_free_list.h
@@ -1,8 +1,7 @@
 #ifndef _AOS_VISION_EVENTS_INTRUSIVE_FREE_LIST_H_
 #define _AOS_VISION_EVENTS_INTRUSIVE_FREE_LIST_H_
 
-namespace aos {
-namespace events {
+namespace aos::events {
 
 // Hey! Maybe you want a doubly linked list that frees things for you!
 // This allows the entry to delete itself, removing it from the list, or
@@ -75,7 +74,6 @@
   T *begin_;
 };
 
-}  // namespace events
-}  // namespace aos
+}  // namespace aos::events
 
 #endif  // _AOS_VISION_EVENTS_INTRUSIVE_FREE_LIST_H_
diff --git a/aos/vision/events/tcp_client.cc b/aos/vision/events/tcp_client.cc
index 0a926db..65b646c 100644
--- a/aos/vision/events/tcp_client.cc
+++ b/aos/vision/events/tcp_client.cc
@@ -15,8 +15,7 @@
 
 #include "aos/logging/logging.h"
 
-namespace aos {
-namespace events {
+namespace aos::events {
 
 namespace {
 int MakeSocketNonBlocking(int sfd) {
@@ -63,5 +62,4 @@
 TcpClient::TcpClient(const std::string &hostname, int portno)
     : EpollEvent(OpenClient(hostname, portno)) {}
 
-}  // namespace events
-}  // namespace aos
+}  // namespace aos::events
diff --git a/aos/vision/events/tcp_server.cc b/aos/vision/events/tcp_server.cc
index cf4dd7f..fa2a369 100644
--- a/aos/vision/events/tcp_server.cc
+++ b/aos/vision/events/tcp_server.cc
@@ -16,8 +16,7 @@
 
 #include "aos/logging/logging.h"
 
-namespace aos {
-namespace events {
+namespace aos::events {
 
 namespace {
 
@@ -108,5 +107,4 @@
   loop()->Add(Construct(infd));
 }
 
-}  // namespace events
-}  // namespace aos
+}  // namespace aos::events
diff --git a/aos/vision/events/udp.cc b/aos/vision/events/udp.cc
index 2aaac82..cf7ad23 100644
--- a/aos/vision/events/udp.cc
+++ b/aos/vision/events/udp.cc
@@ -4,8 +4,7 @@
 
 #include "glog/logging.h"
 
-namespace aos {
-namespace events {
+namespace aos::events {
 
 TXUdpSocket::TXUdpSocket(const std::string &ip_addr, int port)
     : fd_(socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) {
@@ -49,5 +48,4 @@
   return result;
 }
 
-}  // namespace events
-}  // namespace aos
+}  // namespace aos::events
diff --git a/aos/vision/events/udp_test.cc b/aos/vision/events/udp_test.cc
index 33fb4d6..506be28 100644
--- a/aos/vision/events/udp_test.cc
+++ b/aos/vision/events/udp_test.cc
@@ -2,8 +2,7 @@
 
 #include "gtest/gtest.h"
 
-namespace aos {
-namespace events {
+namespace aos::events {
 
 TEST(UDPTest, SendRecv) {
   RXUdpSocket rx(1109);
@@ -19,5 +18,4 @@
   EXPECT_EQ(txdata[3], rxdata[3]);
 }
 
-}  // namespace events
-}  // namespace aos
+}  // namespace aos::events
diff --git a/aos/vision/image/image_dataset.cc b/aos/vision/image/image_dataset.cc
index a15ccb4..82a8886 100644
--- a/aos/vision/image/image_dataset.cc
+++ b/aos/vision/image/image_dataset.cc
@@ -4,8 +4,7 @@
 
 #include "aos/vision/image/image_types.h"
 
-namespace aos {
-namespace vision {
+namespace aos::vision {
 
 namespace {
 std::string GetFileContents(const std::string &filename) {
@@ -82,5 +81,4 @@
   return images;
 }
 
-}  // namespace vision
-}  // namespace aos
+}  // namespace aos::vision
diff --git a/aos/vision/image/image_stream.cc b/aos/vision/image/image_stream.cc
index 62f5e81..fe42efc 100644
--- a/aos/vision/image/image_stream.cc
+++ b/aos/vision/image/image_stream.cc
@@ -2,8 +2,7 @@
 
 #include "aos/logging/logging.h"
 
-namespace aos {
-namespace vision {
+namespace aos::vision {
 
 void ImageStreamEvent::ProcessHelper(
     DataRef data, aos::monotonic_clock::time_point timestamp) {
@@ -14,5 +13,4 @@
   ProcessImage(data, timestamp);
 }
 
-}  // namespace vision
-}  // namespace aos
+}  // namespace aos::vision
diff --git a/aos/vision/image/jpeg_routines.cc b/aos/vision/image/jpeg_routines.cc
index b41729f..9d46895 100644
--- a/aos/vision/image/jpeg_routines.cc
+++ b/aos/vision/image/jpeg_routines.cc
@@ -14,8 +14,7 @@
 
 #include "aos/logging/logging.h"
 
-namespace aos {
-namespace vision {
+namespace aos::vision {
 
 namespace {
 
@@ -248,5 +247,4 @@
   return true;
 }
 
-}  // namespace vision
-}  // namespace aos
+}  // namespace aos::vision
diff --git a/aos/vision/math/vector_test.cc b/aos/vision/math/vector_test.cc
index 8c5244d..214a50c 100644
--- a/aos/vision/math/vector_test.cc
+++ b/aos/vision/math/vector_test.cc
@@ -2,9 +2,7 @@
 
 #include "gtest/gtest.h"
 
-namespace aos {
-namespace vision {
-namespace testing {
+namespace aos::vision::testing {
 
 class VectorTest : public ::testing::Test {
  protected:
@@ -71,6 +69,4 @@
   EXPECT_NEAR(M_PI / 3, vec5.AngleToZero(), 0.0001);
 }
 
-}  // namespace testing
-}  // namespace vision
-}  // namespace aos
+}  // namespace aos::vision::testing
diff --git a/aos/vision/tools/jpeg_vision_test.cc b/aos/vision/tools/jpeg_vision_test.cc
index ef2ec6d..553419a 100644
--- a/aos/vision/tools/jpeg_vision_test.cc
+++ b/aos/vision/tools/jpeg_vision_test.cc
@@ -25,8 +25,7 @@
 #include "aos/vision/image/reader.h"
 #include "aos/vision/math/vector.h"
 
-namespace aos {
-namespace vision {
+namespace aos::vision {
 
 void DrawVLine(ImagePtr ptr, int x, PixelRef color = {255, 0, 0}) {
   for (int y = 0; y < ptr.fmt().h; ++y) {
@@ -108,8 +107,7 @@
   int dx = 0;
   int dy = 0;
 };
-}  // namespace vision
-}  // namespace aos
+}  // namespace aos::vision
 
 int main(int argc, char *argv[]) {
   ::aos::logging::Init();