Skip to content

Commit 6c7faac

Browse files
authored
CXX-2370 fix lint (#832)
1 parent c805491 commit 6c7faac

File tree

6 files changed

+26
-28
lines changed

6 files changed

+26
-28
lines changed

src/bsoncxx/private/helpers.hh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ something that can be improved as part of CXX-2350 (migration to more recent C++
4444
standards).
4545
*/
4646
inline bsoncxx::oid make_oid(const bson_oid_t* bson_oid) {
47-
return bsoncxx::oid(reinterpret_cast<const char*>(bson_oid),
48-
bsoncxx::oid::size());
47+
return bsoncxx::oid(reinterpret_cast<const char*>(bson_oid), bsoncxx::oid::size());
4948
}
5049

5150
} // namespace helpers

src/bsoncxx/types/bson_value/view.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ view& view::operator=(const view& rhs) noexcept {
8989
break;
9090
#include <bsoncxx/enums/type.hpp>
9191
#undef BSONCXX_ENUM
92-
default : break;
92+
default:
93+
break;
9394
}
9495

9596
_type = rhs._type;

src/mongocxx/test/collection.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2333,10 +2333,10 @@ TEST_CASE("read_concern is inherited from parent", "[collection]") {
23332333
}
23342334
}
23352335

2336-
void find_index_and_validate(
2337-
collection& coll,
2338-
stdx::string_view index_name,
2339-
const std::function<void(bsoncxx::document::view)>& validate = [](bsoncxx::document::view) {}) {
2336+
void find_index_and_validate(collection& coll,
2337+
stdx::string_view index_name,
2338+
const std::function<void(bsoncxx::document::view)>& validate =
2339+
[](bsoncxx::document::view) {}) {
23402340
auto cursor = coll.list_indexes();
23412341

23422342
for (auto&& index : cursor) {

src/mongocxx/test/database.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ TEST_CASE("Database integration tests", "[database]") {
495495
// As C++11 lacks generic lambdas, and "ordinary" templates can't appear at block scope,
496496
// we'll have to define our helper for the serviceId tests here. This implementation would
497497
// be more straightforward in newer versions of C++ (C++14 and on allow generic lambdas),
498-
// see CXX-2350 (migration to more recent C++ standards); our C++17 optional<> implementation
498+
// see CXX-2350 (migration to more recent C++ standards); our C++17 optional<> implementation
499499
// also has a few inconsistencies with the standard, which appear to vary across platforms.
500500
template <typename EventT>
501501
struct check_service_id {
@@ -544,10 +544,10 @@ TEST_CASE("serviceId presence depends on load-balancing mode") {
544544
// Set up mocked functions that DO emit a service_id:
545545
if (expect_service_id) {
546546
// Return a bson_oid_t with data where the service_id has some value:
547-
const auto make_service_id_bson_oid_t = [](const void *) -> const bson_oid_t* {
548-
static bson_oid_t tmp = { 0x65 };
549-
return &tmp;
550-
};
547+
const auto make_service_id_bson_oid_t = [](const void*) -> const bson_oid_t* {
548+
static bson_oid_t tmp = {0x65};
549+
return &tmp;
550+
};
551551

552552
// Add forever() so that the mock function also extends to endSession:
553553
apm_command_started_get_service_id->interpose(make_service_id_bson_oid_t).forever();

src/mongocxx/test/uri.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -333,20 +333,18 @@ TEST_CASE("uri::compressors()", "[uri]") {
333333

334334
// Zero is not allowed for heartbeatFrequencyMS.
335335
TEST_CASE("uri::heartbeat_frequency_ms()", "[uri]") {
336-
_test_int32_option(
337-
"heartbeatFrequencyMS",
338-
[](mongocxx::uri& uri) { return uri.heartbeat_frequency_ms(); },
339-
"1234",
340-
false);
336+
_test_int32_option("heartbeatFrequencyMS",
337+
[](mongocxx::uri& uri) { return uri.heartbeat_frequency_ms(); },
338+
"1234",
339+
false);
341340
}
342341

343342
// -1 to 9 are only valid values of zlib compression level.
344343
TEST_CASE("uri::zlib_compression_level()", "[uri]") {
345-
_test_int32_option(
346-
"zlibCompressionLevel",
347-
[](mongocxx::uri& uri) { return uri.zlib_compression_level(); },
348-
"5",
349-
true);
344+
_test_int32_option("zlibCompressionLevel",
345+
[](mongocxx::uri& uri) { return uri.zlib_compression_level(); },
346+
"5",
347+
true);
350348
}
351349

352350
// End special cases.

src/mongocxx/uri.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@ std::string uri::password() const {
9797

9898
class read_concern uri::read_concern() const {
9999
auto rc = libmongoc::uri_get_read_concern(_impl->uri_t);
100-
return (class read_concern)(stdx::make_unique<read_concern::impl>(
101-
libmongoc::read_concern_copy(rc)));
100+
return (class read_concern)(
101+
stdx::make_unique<read_concern::impl>(libmongoc::read_concern_copy(rc)));
102102
}
103103

104104
class read_preference uri::read_preference() const {
105105
auto rp = libmongoc::uri_get_read_prefs_t(_impl->uri_t);
106-
return (class read_preference)(stdx::make_unique<read_preference::impl>(
107-
libmongoc::read_prefs_copy(rp)));
106+
return (class read_preference)(
107+
stdx::make_unique<read_preference::impl>(libmongoc::read_prefs_copy(rp)));
108108
}
109109

110110
std::string uri::replica_set() const {
@@ -129,8 +129,8 @@ std::string uri::username() const {
129129

130130
class write_concern uri::write_concern() const {
131131
auto wc = libmongoc::uri_get_write_concern(_impl->uri_t);
132-
return (class write_concern)(stdx::make_unique<write_concern::impl>(
133-
libmongoc::write_concern_copy(wc)));
132+
return (class write_concern)(
133+
stdx::make_unique<write_concern::impl>(libmongoc::write_concern_copy(wc)));
134134
}
135135

136136
static stdx::optional<stdx::string_view> _string_option(mongoc_uri_t* uri, std::string opt_name) {

0 commit comments

Comments
 (0)