Skip to content

Commit 2f4e3ca

Browse files
committed
rename chkData innermost field to value
This avoids situations where you have to write `results.list[0].id.id` when contact::CheckData. Changes all other equivalent structs to be consistent.
1 parent c205918 commit 2f4e3ca

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/contact/check.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub struct ContactId {
4848
#[xml(attribute, rename = "avail")]
4949
pub available: bool,
5050
#[xml(direct)]
51-
pub id: String,
51+
pub value: String,
5252
}
5353

5454
#[derive(Debug, FromXml)]
@@ -97,9 +97,9 @@ mod tests {
9797

9898
assert_eq!(object.result.code, ResultCode::CommandCompletedSuccessfully);
9999
assert_eq!(object.result.message, SUCCESS_MSG);
100-
assert_eq!(results.list[0].id.id, "eppdev-contact-1");
100+
assert_eq!(results.list[0].id.value, "eppdev-contact-1");
101101
assert!(!results.list[0].id.available);
102-
assert_eq!(results.list[1].id.id, "eppdev-contact-2");
102+
assert_eq!(results.list[1].id.value, "eppdev-contact-2");
103103
assert!(results.list[1].id.available);
104104
assert_eq!(object.tr_ids.client_tr_id.unwrap(), CLTRID);
105105
assert_eq!(object.tr_ids.server_tr_id, SVTRID);

src/domain/check.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub struct Name {
4747
#[xml(attribute, rename = "avail")]
4848
pub available: bool,
4949
#[xml(direct)]
50-
pub id: String,
50+
pub value: String,
5151
}
5252

5353
#[derive(Debug, FromXml)]
@@ -96,9 +96,9 @@ mod tests {
9696

9797
assert_eq!(object.result.code, ResultCode::CommandCompletedSuccessfully);
9898
assert_eq!(object.result.message, SUCCESS_MSG);
99-
assert_eq!(result.list[0].name.id, "eppdev.com");
99+
assert_eq!(result.list[0].name.value, "eppdev.com");
100100
assert!(result.list[0].name.available);
101-
assert_eq!(result.list[1].name.id, "eppdev.net");
101+
assert_eq!(result.list[1].name.value, "eppdev.net");
102102
assert!(!result.list[1].name.available);
103103
assert!(!result.list[2].name.available);
104104
assert_eq!(result.list[2].reason.as_ref().unwrap().value, "In Use");

src/host/check.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pub struct Name {
5050
pub available: bool,
5151

5252
#[xml(direct)]
53-
pub id: String,
53+
pub value: String,
5454
}
5555

5656
#[derive(Debug, FromXml)]
@@ -99,9 +99,9 @@ mod tests {
9999

100100
assert_eq!(object.result.code, ResultCode::CommandCompletedSuccessfully);
101101
assert_eq!(object.result.message, SUCCESS_MSG);
102-
assert_eq!(result.list[0].name.id, "host1.eppdev-1.com");
102+
assert_eq!(result.list[0].name.value, "host1.eppdev-1.com");
103103
assert!(result.list[0].name.available);
104-
assert_eq!(result.list[1].name.id, "ns1.testing.com");
104+
assert_eq!(result.list[1].name.value, "ns1.testing.com");
105105
assert!(!result.list[1].name.available);
106106
assert_eq!(object.tr_ids.client_tr_id.unwrap(), CLTRID);
107107
assert_eq!(object.tr_ids.server_tr_id, SVTRID);

tests/basic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ async fn client() {
132132
assert_eq!(rsp.result.code, ResultCode::CommandCompletedSuccessfully);
133133

134134
let result = rsp.res_data().unwrap();
135-
assert_eq!(result.list[0].name.id, "eppdev.com");
135+
assert_eq!(result.list[0].name.value, "eppdev.com");
136136
}
137137

138138
#[tokio::test]

0 commit comments

Comments
 (0)