From: Michael Lee Date: Wed, 20 Apr 2016 20:24:25 +0000 (-0700) Subject: Clean up deprecation warnings X-Git-Tag: 2016.07.26~337 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6086ec0c1100dcb018dc84628ed954a696e47cdf;p=folly.git 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 --- 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(); } }