Skip to content

Commit 683a822

Browse files
authored
RUST-805 Remove remaining oppressive language from the source code (#616)
1 parent cac6bad commit 683a822

File tree

4 files changed

+21
-16
lines changed

4 files changed

+21
-16
lines changed

src/cmap/establish/handshake/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ impl Handshaker {
258258
.map(|server_first| client_first.into_first_round(server_first))
259259
});
260260

261-
// Check that master reply has a compressor list and unpack it
261+
// Check that the hello reply has a compressor list and unpack it
262262
if let (Some(server_compressors), Some(client_compressors)) = (
263263
hello_reply.command_response.compressors.as_ref(),
264264
self.compressors.as_ref(),

src/error.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use thiserror::Error;
1313
use crate::{bson::Document, options::ServerAddress};
1414

1515
const RECOVERING_CODES: [i32; 5] = [11600, 11602, 13436, 189, 91];
16-
const NOTMASTER_CODES: [i32; 3] = [10107, 13435, 10058];
16+
const NOTWRITABLEPRIMARY_CODES: [i32; 3] = [10107, 13435, 10058];
1717
const SHUTTING_DOWN_CODES: [i32; 2] = [11600, 91];
1818
const RETRYABLE_READ_CODES: [i32; 11] =
1919
[11600, 11602, 10107, 13435, 13436, 189, 91, 7, 6, 89, 9001];
@@ -111,7 +111,7 @@ impl Error {
111111
}
112112

113113
pub(crate) fn is_state_change_error(&self) -> bool {
114-
self.is_recovering() || self.is_not_master()
114+
self.is_recovering() || self.is_notwritableprimary()
115115
}
116116

117117
pub(crate) fn is_auth_error(&self) -> bool {
@@ -297,10 +297,10 @@ impl Error {
297297
}
298298
}
299299

300-
/// If this error corresponds to a "not master" error as per the SDAM spec.
301-
pub(crate) fn is_not_master(&self) -> bool {
300+
/// If this error corresponds to a "not writable primary" error as per the SDAM spec.
301+
pub(crate) fn is_notwritableprimary(&self) -> bool {
302302
self.code()
303-
.map(|code| NOTMASTER_CODES.contains(&code))
303+
.map(|code| NOTWRITABLEPRIMARY_CODES.contains(&code))
304304
.unwrap_or(false)
305305
}
306306

src/sdam/description/topology/test/sdam.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ async fn direct_connection() {
701701
.insert_one(doc! {}, None)
702702
.await
703703
.expect_err("write should fail with directConnection=true on secondary");
704-
assert!(error.is_not_master());
704+
assert!(error.is_notwritableprimary());
705705

706706
let client =
707707
Client::with_options(secondary_options).expect("client construction should succeed");

src/test/spec/connection_stepdown.rs

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,15 @@ async fn get_more() {
122122
#[function_name::named]
123123
#[cfg_attr(feature = "tokio-runtime", tokio::test)]
124124
#[cfg_attr(feature = "async-std-runtime", async_std::test)]
125-
async fn not_master_keep_pool() {
126-
async fn not_master_keep_pool_test(
125+
async fn notwritableprimary_keep_pool() {
126+
async fn notwritableprimary_keep_pool_test(
127127
client: EventClient,
128128
_db: Database,
129129
coll: Collection<Document>,
130130
) {
131131
// This test requires server version 4.2 or higher.
132132
if client.server_version_lt(4, 2) {
133-
log_uncaptured("skipping not_master_keep_pool due to server version < 4.2");
133+
log_uncaptured("skipping notwritableprimary_keep_pool due to server version < 4.2");
134134
return;
135135
}
136136

@@ -167,21 +167,22 @@ async fn not_master_keep_pool() {
167167
assert_eq!(client.count_pool_cleared_events(), 0);
168168
}
169169

170-
run_test(function_name!(), not_master_keep_pool_test).await;
170+
run_test(function_name!(), notwritableprimary_keep_pool_test).await;
171171
}
172172

173-
#[function_name::named]
174173
#[cfg_attr(feature = "tokio-runtime", tokio::test)]
175174
#[cfg_attr(feature = "async-std-runtime", async_std::test)]
176-
async fn not_master_reset_pool() {
177-
async fn not_master_reset_pool_test(
175+
async fn notwritableprimary_reset_pool() {
176+
async fn notwritableprimary_reset_pool_test(
178177
client: EventClient,
179178
_db: Database,
180179
coll: Collection<Document>,
181180
) {
182181
// This test must only run on 4.0 servers.
183182
if !client.server_version_eq(4, 0) {
184-
log_uncaptured("skipping not_master_reset_pool due to unsupported server version");
183+
log_uncaptured(
184+
"skipping notwritableprimary_reset_pool due to unsupported server version",
185+
);
185186
return;
186187
}
187188

@@ -218,7 +219,11 @@ async fn not_master_reset_pool() {
218219
.expect("insert should have succeeded");
219220
}
220221

221-
run_test(function_name!(), not_master_reset_pool_test).await;
222+
run_test(
223+
"notwritableprimary_reset_pool",
224+
notwritableprimary_reset_pool_test,
225+
)
226+
.await;
222227
}
223228

224229
#[function_name::named]

0 commit comments

Comments
 (0)