Stop using ScopeGuardImpl in DynamicParser
[folly.git] / folly / experimental / DynamicParser.cpp
index 734013c90fdda8d1d42f79e55f9ddbb3ce915366..6e07ff71f1c0891c807efd764561389cf14b4892 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2016-present Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -42,7 +42,7 @@ folly::dynamic& insertAtKey(
     "Unsupported key type ", key.typeName(), " of ", detail::toPseudoJson(key)
   );
 }
-}  // anonymous namespace
+} // namespace
 
 void DynamicParser::reportError(
     const folly::dynamic* lookup_k,
@@ -117,14 +117,11 @@ void DynamicParser::ParserStack::Pop::operator()() noexcept {
   }
 }
 
-folly::ScopeGuardImpl<DynamicParser::ParserStack::Pop>
-DynamicParser::ParserStack::push(
+DynamicParser::ParserStack::PopGuard DynamicParser::ParserStack::push(
     const folly::dynamic& k,
     const folly::dynamic& v) noexcept {
   // Save the previous state of the parser.
-  folly::ScopeGuardImpl<DynamicParser::ParserStack::Pop> guard(
-    DynamicParser::ParserStack::Pop(this)
-  );
+  DynamicParser::ParserStack::PopGuard guard{this};
   key_ = &k;
   value_ = &v;
   // We create errors_ sub-objects lazily to keep the result small.
@@ -187,6 +184,6 @@ std::string toPseudoJson(const folly::dynamic& d) {
   ss << d;
   return ss.str();
 }
-}  // namespace detail
+} // namespace detail
 
-}  // namespace folly
+} // namespace folly