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/motors/usb/cdc.cc b/motors/usb/cdc.cc
index e082156..5a668d8 100644
--- a/motors/usb/cdc.cc
+++ b/motors/usb/cdc.cc
@@ -19,8 +19,7 @@
     }                                        \
   } while (false)
 
-namespace frc971 {
-namespace teensy {
+namespace frc971::teensy {
 namespace {
 
 // Aka the Communications Device Class code, the Communications Class code,
@@ -428,5 +427,4 @@
   }
 }
 
-}  // namespace teensy
-}  // namespace frc971
+}  // namespace frc971::teensy
diff --git a/motors/usb/constants.h b/motors/usb/constants.h
index 58c9ecc..6970639 100644
--- a/motors/usb/constants.h
+++ b/motors/usb/constants.h
@@ -3,8 +3,7 @@
 
 #include <stdint.h>
 
-namespace frc971 {
-namespace teensy {
+namespace frc971::teensy {
 
 enum class Direction : uint32_t {
   kTx = 1 << 1,
@@ -108,7 +107,6 @@
                              static_cast<uint32_t>(Data01::kData1));
 }
 
-}  // namespace teensy
-}  // namespace frc971
+}  // namespace frc971::teensy
 
 #endif  // MOTORS_USB_CONSTANTS_H_
diff --git a/motors/usb/constants_test.cc b/motors/usb/constants_test.cc
index 4d11349..66e0ea5 100644
--- a/motors/usb/constants_test.cc
+++ b/motors/usb/constants_test.cc
@@ -2,9 +2,7 @@
 
 #include "gtest/gtest.h"
 
-namespace frc971 {
-namespace teensy {
-namespace testing {
+namespace frc971::teensy::testing {
 
 TEST(EndpointBufferStateTest, Filling) {
   EXPECT_TRUE(BufferStateHasEmpty(EndpointBufferState::kBothEmptyEvenFirst));
@@ -61,6 +59,4 @@
             BufferStateAfterEmpty(EndpointBufferState::kBothFullEvenFirst));
 }
 
-}  // namespace testing
-}  // namespace teensy
-}  // namespace frc971
+}  // namespace frc971::teensy::testing
diff --git a/motors/usb/hid.cc b/motors/usb/hid.cc
index f42842b..5efa431 100644
--- a/motors/usb/hid.cc
+++ b/motors/usb/hid.cc
@@ -1,7 +1,6 @@
 #include "motors/usb/hid.h"
 
-namespace frc971 {
-namespace teensy {
+namespace frc971::teensy {
 namespace {
 
 constexpr uint8_t hid_class() { return 0x03; }
@@ -210,5 +209,4 @@
   }
 }
 
-}  // namespace teensy
-}  // namespace frc971
+}  // namespace frc971::teensy
diff --git a/motors/usb/interrupt_out.cc b/motors/usb/interrupt_out.cc
index 568e5c5..30f024e 100644
--- a/motors/usb/interrupt_out.cc
+++ b/motors/usb/interrupt_out.cc
@@ -1,7 +1,6 @@
 #include "motors/usb/interrupt_out.h"
 
-namespace frc971 {
-namespace teensy {
+namespace frc971::teensy {
 
 void InterruptOut::Initialize() {
   interface_ = AddInterface();
@@ -86,5 +85,4 @@
   }
 }
 
-}  // namespace teensy
-}  // namespace frc971
+}  // namespace frc971::teensy
diff --git a/motors/usb/queue.cc b/motors/usb/queue.cc
index 270ad74..3d2e283 100644
--- a/motors/usb/queue.cc
+++ b/motors/usb/queue.cc
@@ -4,8 +4,7 @@
 
 #include <algorithm>
 
-namespace frc971 {
-namespace teensy {
+namespace frc971::teensy {
 
 size_t Queue::Read(char *out_data, size_t out_size) {
   const size_t read_cursor = read_cursor_.load(::std::memory_order_relaxed);
@@ -30,5 +29,4 @@
   return r;
 }
 
-}  // namespace teensy
-}  // namespace frc971
+}  // namespace frc971::teensy
diff --git a/motors/usb/queue_test.cc b/motors/usb/queue_test.cc
index fed54d6..8973a6c 100644
--- a/motors/usb/queue_test.cc
+++ b/motors/usb/queue_test.cc
@@ -2,9 +2,7 @@
 
 #include "gtest/gtest.h"
 
-namespace frc971 {
-namespace teensy {
-namespace testing {
+namespace frc971::teensy::testing {
 
 TEST(QueueTest, Basic) {
   Queue queue(64);
@@ -40,6 +38,4 @@
   ASSERT_TRUE(queue.empty());
 }
 
-}  // namespace testing
-}  // namespace teensy
-}  // namespace frc971
+}  // namespace frc971::teensy::testing
diff --git a/motors/usb/usb.cc b/motors/usb/usb.cc
index 2c64b61..e5e581b 100644
--- a/motors/usb/usb.cc
+++ b/motors/usb/usb.cc
@@ -6,8 +6,7 @@
 
 #include "motors/util.h"
 
-namespace frc971 {
-namespace teensy {
+namespace frc971::teensy {
 namespace {
 
 // The mask of interrupts we care about.
@@ -1068,5 +1067,4 @@
   *MutableBdtEntry(endpoint, direction, odd) = bdt_entry;
 }
 
-}  // namespace teensy
-}  // namespace frc971
+}  // namespace frc971::teensy