Skip to content

Commit 1103a14

Browse files
RUST-433 Rename "Tag" Acknowledgement case to "Custom" (#183)
1 parent 288a9a7 commit 1103a14

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/concern/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@ pub enum Acknowledgment {
165165
Nodes(i32),
166166
/// Requires acknowledgement that the write has reached the majority of nodes.
167167
Majority,
168-
/// Requires acknowledgement according to the given write tag. See [here](https://docs.mongodb.com/manual/tutorial/configure-replica-set-tag-sets/#tag-sets-and-custom-write-concern-behavior)
168+
/// Requires acknowledgement according to the given custom write concern. See [here](https://docs.mongodb.com/manual/tutorial/configure-replica-set-tag-sets/#tag-sets-and-custom-write-concern-behavior)
169169
/// for more information.
170-
Tag(String),
170+
Custom(String),
171171
}
172172

173173
impl Serialize for Acknowledgment {
@@ -178,7 +178,7 @@ impl Serialize for Acknowledgment {
178178
match self {
179179
Acknowledgment::Majority => serializer.serialize_str("majority"),
180180
Acknowledgment::Nodes(n) => serializer.serialize_i32(n.clone()),
181-
Acknowledgment::Tag(tag) => serializer.serialize_str(tag),
181+
Acknowledgment::Custom(name) => serializer.serialize_str(name),
182182
}
183183
}
184184
}
@@ -212,7 +212,7 @@ impl From<String> for Acknowledgment {
212212
if s == "majority" {
213213
Acknowledgment::Majority
214214
} else {
215-
Acknowledgment::Tag(s)
215+
Acknowledgment::Custom(s)
216216
}
217217
}
218218
}
@@ -226,7 +226,7 @@ impl Acknowledgment {
226226
match self {
227227
Acknowledgment::Nodes(i) => Bson::I64(i64::from(*i)),
228228
Acknowledgment::Majority => Bson::String("majority".to_string()),
229-
Acknowledgment::Tag(s) => Bson::String(s.to_string()),
229+
Acknowledgment::Custom(s) => Bson::String(s.to_string()),
230230
}
231231
}
232232
}

src/operation/drop_collection/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use crate::{
1414
async fn build() {
1515
let options = DropCollectionOptions {
1616
write_concern: Some(WriteConcern {
17-
w: Some(Acknowledgment::Tag("abc".to_string())),
17+
w: Some(Acknowledgment::Custom("abc".to_string())),
1818
..Default::default()
1919
}),
2020
};

src/operation/drop_database/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ async fn build() {
1515
target_db: "test_db".to_string(),
1616
options: Some(DropDatabaseOptions {
1717
write_concern: Some(WriteConcern {
18-
w: Some(Acknowledgment::Tag("abc".to_string())),
18+
w: Some(Acknowledgment::Custom("abc".to_string())),
1919
..Default::default()
2020
}),
2121
}),

src/sync/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ fn collection() {
115115
assert_eq!(results, vec![doc! { "x": 1 }]);
116116

117117
let wc = WriteConcern {
118-
w: Acknowledgment::Tag("hello".to_string()).into(),
118+
w: Acknowledgment::Custom("hello".to_string()).into(),
119119
journal: None,
120120
w_timeout: None,
121121
};

0 commit comments

Comments
 (0)