summaryrefslogtreecommitdiff
path: root/src/mongo/idl
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/idl')
-rw-r--r--src/mongo/idl/server_parameter_specialized_test.cpp6
-rw-r--r--src/mongo/idl/server_parameter_with_storage.h3
2 files changed, 5 insertions, 4 deletions
diff --git a/src/mongo/idl/server_parameter_specialized_test.cpp b/src/mongo/idl/server_parameter_specialized_test.cpp
index 07ce7e4dc8c..7bf9cdb6bc6 100644
--- a/src/mongo/idl/server_parameter_specialized_test.cpp
+++ b/src/mongo/idl/server_parameter_specialized_test.cpp
@@ -144,7 +144,7 @@ void SpecializedWithValueServerParameter::append(OperationContext*,
}
Status SpecializedWithValueServerParameter::setFromString(const std::string& value) {
- return parseNumberFromString(value, &_data);
+ return NumberParser{}(value, &_data);
}
TEST(SpecializedServerParameter, withValue) {
@@ -195,7 +195,7 @@ void SpecializedWithAtomicValueServerParameter::append(OperationContext*,
Status SpecializedWithAtomicValueServerParameter::setFromString(const std::string& value) {
std::uint32_t val;
- auto status = parseNumberFromString(value, &val);
+ auto status = NumberParser{}(value, &val);
if (!status.isOK()) {
return status;
}
@@ -275,7 +275,7 @@ void SpecializedWithCtorAndValueServerParameter::append(OperationContext*,
}
Status SpecializedWithCtorAndValueServerParameter::setFromString(const std::string& value) {
- return parseNumberFromString(value, &_data);
+ return NumberParser{}(value, &_data);
}
TEST(SpecializedServerParameter, withCtorAndValue) {
diff --git a/src/mongo/idl/server_parameter_with_storage.h b/src/mongo/idl/server_parameter_with_storage.h
index 0da90e950f7..30d1d4abc7d 100644
--- a/src/mongo/idl/server_parameter_with_storage.h
+++ b/src/mongo/idl/server_parameter_with_storage.h
@@ -38,6 +38,7 @@
#include <functional>
#include <string>
+#include "mongo/base/parse_number.h"
#include "mongo/base/status.h"
#include "mongo/base/string_data.h"
#include "mongo/bson/bsonelement.h"
@@ -54,7 +55,7 @@ namespace idl_server_parameter_detail {
template <typename T>
inline StatusWith<T> coerceFromString(StringData str) {
T value;
- Status status = parseNumberFromString(str, &value);
+ Status status = NumberParser{}(str, &value);
if (!status.isOK()) {
return status;
}