storage/Plugin: return std::unique_ptr<Storage>

This commit is contained in:
Max Kellermann
2018-01-02 16:11:17 +01:00
parent 3f4f7b0a53
commit 3c5e4e2788
15 changed files with 46 additions and 32 deletions

View File

@@ -549,14 +549,14 @@ CurlStorage::OpenDirectory(const char *uri_utf8)
return HttpListDirectoryOperation(*curl, uri.c_str()).Perform();
}
static Storage *
static std::unique_ptr<Storage>
CreateCurlStorageURI(EventLoop &event_loop, const char *uri)
{
if (strncmp(uri, "http://", 7) != 0 &&
strncmp(uri, "https://", 8) != 0)
return nullptr;
return new CurlStorage(event_loop, uri);
return std::make_unique<CurlStorage>(event_loop, uri);
}
const StoragePlugin curl_storage_plugin = {