From 6086ec0c1100dcb018dc84628ed954a696e47cdf Mon Sep 17 00:00:00 2001 From: Michael Lee Date: Wed, 20 Apr 2016 13:24:25 -0700 Subject: [PATCH] Clean up deprecation warnings 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 | 4 +++- folly/experimental/JSONSchema.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/folly/experimental/JSONSchema.cpp b/folly/experimental/JSONSchema.cpp index ac822b1b..96d53d56 100644 --- a/folly/experimental/JSONSchema.cpp +++ b/folly/experimental/JSONSchema.cpp @@ -1020,6 +1020,8 @@ std::unique_ptr makeValidator(const dynamic& schema) { return std::move(v); } -Validator* makeSchemaValidator() { return schemaValidator.get(); } +std::shared_ptr makeSchemaValidator() { + return schemaValidator.try_get(); +} } } diff --git a/folly/experimental/JSONSchema.h b/folly/experimental/JSONSchema.h index fe53b7ad..e1772e2c 100644 --- a/folly/experimental/JSONSchema.h +++ b/folly/experimental/JSONSchema.h @@ -68,6 +68,6 @@ std::unique_ptr 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 makeSchemaValidator(); } } -- 2.34.1