Skip to content

Commit 3c535d1

Browse files
committed
Use implicit nullables.
1 parent 2271904 commit 3c535d1

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/rest/rest.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,9 @@ code path_to_request(request_t& out, const std::string& path) NOEXCEPT
226226
const auto hash = to_hash(segments[segment++]);
227227
if (!hash) return error::invalid_hash;
228228

229+
// nullables can be implicit.
230+
////params["height"] = null_t{};
229231
params["hash"] = hash;
230-
params["height"] = null_t{};
231232
}
232233
else if (by == "height")
233234
{
@@ -238,7 +239,8 @@ code path_to_request(request_t& out, const std::string& path) NOEXCEPT
238239
if (!to_number(height, segments[segment++]))
239240
return error::invalid_number;
240241

241-
params["hash"] = null_t{};
242+
// nullables can be implicit.
243+
////params["hash"] = null_t{};
242244
params["height"] = height;
243245
}
244246
else

test/rest/rest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ BOOST_AUTO_TEST_CASE(path_to_request__block_height_valid___expected_request)
8484
BOOST_REQUIRE(std::holds_alternative<object_t>(params));
8585

8686
const auto& object = std::get<object_t>(request.params.value());
87-
BOOST_REQUIRE_EQUAL(object.size(), 3u);
87+
BOOST_REQUIRE_EQUAL(object.size(), 2u);
8888

8989
const auto version = std::get<uint8_t>(object.at("version").value());
9090
BOOST_REQUIRE_EQUAL(version, 42u);

0 commit comments

Comments
 (0)