summaryrefslogtreecommitdiff
path: root/src/mongo/db/auth/address_restriction.cpp
diff options
context:
space:
mode:
authorBilly Donahue <BillyDonahue@users.noreply.github.com>2022-07-27 18:17:24 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-07-27 19:38:08 +0000
commit958ad9abfc80861d3f43f44da694e83464b01e1d (patch)
treeca14e7097c1cb8ab20dfad7fa6888511f0226650 /src/mongo/db/auth/address_restriction.cpp
parentf8a1ac19be6279e7ace012dafa8cfcaa028d49e1 (diff)
downloadmongo-958ad9abfc80861d3f43f44da694e83464b01e1d.tar.gz
SERVER-68246 rewrite calls to boost::optional get and is_initialized
Diffstat (limited to 'src/mongo/db/auth/address_restriction.cpp')
-rw-r--r--src/mongo/db/auth/address_restriction.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mongo/db/auth/address_restriction.cpp b/src/mongo/db/auth/address_restriction.cpp
index e8fd687bc75..c6aa462dcee 100644
--- a/src/mongo/db/auth/address_restriction.cpp
+++ b/src/mongo/db/auth/address_restriction.cpp
@@ -49,12 +49,12 @@ mongo::StatusWith<mongo::RestrictionSet<>> mongo::parseAddressRestrictionSet(
const boost::optional<std::vector<StringData>>& client = ar.getClientSource();
if (client) {
- vec.push_back(std::make_unique<ClientSourceRestriction>(client.get()));
+ vec.push_back(std::make_unique<ClientSourceRestriction>(client.value()));
}
const boost::optional<std::vector<StringData>>& server = ar.getServerAddress();
if (server) {
- vec.push_back(std::make_unique<ServerAddressRestriction>(server.get()));
+ vec.push_back(std::make_unique<ServerAddressRestriction>(server.value()));
}
if (vec.empty()) {
@@ -109,11 +109,11 @@ mongo::StatusWith<mongo::BSONArray> mongo::getRawAuthenticationRestrictions(
auto const ar = Address_restriction::parse(ctx, elem.Obj());
if (auto const&& client = ar.getClientSource()) {
// Validate
- ClientSourceRestriction(client.get());
+ ClientSourceRestriction(client.value());
}
if (auto const&& server = ar.getServerAddress()) {
// Validate
- ServerAddressRestriction(server.get());
+ ServerAddressRestriction(server.value());
}
if (!ar.getClientSource() && !ar.getServerAddress()) {
return Status(ErrorCodes::CollectionIsEmpty,