Clean up deprecation warnings
authorMichael Lee <mzlee@fb.com>
Wed, 20 Apr 2016 20:24:25 +0000 (13:24 -0700)
committerFacebook Github Bot 3 <facebook-github-bot-3-bot@fb.com>
Wed, 20 Apr 2016 20:35:53 +0000 (13:35 -0700)
Summary:Clean up a deprecation warning for JSONSchema's use of
Singleton. This is in experimental, so the interface change should be
reasonable..

Reviewed By: agoder

Differential Revision: D3203348

fb-gh-sync-id: 3283c7d9c507a545f3217eb5afc3734eb047b833
fbshipit-source-id: 3283c7d9c507a545f3217eb5afc3734eb047b833

folly/experimental/JSONSchema.cpp
folly/experimental/JSONSchema.h

index ac822b1b1fb0b7f91dd738a7706067c66d2f1bc8..96d53d56121128191161301eb3b2a27d077fb989 100644 (file)
@@ -1020,6 +1020,8 @@ std::unique_ptr<Validator> makeValidator(const dynamic& schema) {
   return std::move(v);
 }
 
-Validator* makeSchemaValidator() { return schemaValidator.get(); }
+std::shared_ptr<Validator> makeSchemaValidator() {
+  return schemaValidator.try_get();
+}
 }
 }
index fe53b7adb4d04eb5ecf0c87002e02a4dc2bf9302..e1772e2c63df8993ae256783b04ef7dd3321c8ff 100644 (file)
@@ -68,6 +68,6 @@ std::unique_ptr<Validator> makeValidator(const dynamic& schema);
  * Makes a validator for schemas. You should probably check your schema with
  * this before you use makeValidator().
  */
-Validator* makeSchemaValidator();
+std::shared_ptr<Validator> makeSchemaValidator();
 }
 }