Skip to content

Commit 9b83b11

Browse files
committed
x509-cert: remove DirectoryString::as_ref
1 parent 3c1a63c commit 9b83b11

File tree

2 files changed

+5
-24
lines changed

2 files changed

+5
-24
lines changed

x509-cert/src/ext/pkix/name/dirstr.rs

-13
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,3 @@ impl DirectoryString {
9999
}
100100
}
101101
}
102-
103-
impl AsRef<str> for DirectoryString {
104-
// #[deprecated(since = "0.3.0-pre.0", note = "use `DirectoryString::value` instead")]
105-
fn as_ref(&self) -> &str {
106-
match self {
107-
Self::PrintableString(s) => s.as_ref(),
108-
Self::TeletexString(s) => s.as_ref(),
109-
Self::Utf8String(s) => s.as_ref(),
110-
// TODO(dishmaker): BMPString as ref
111-
Self::BmpString(_s) => "",
112-
}
113-
}
114-
}

x509-cert/tests/name.rs

+5-11
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ fn access_attributes() {
381381
let name = Name::from_str("[email protected],UID=identity:ds.group.3891111,OU=management:ds.group.3891111,CN=OQFAvDNDWs.google.com,O=Google LLC,L=Mountain View,ST=California,C=US").unwrap();
382382

383383
assert_eq!(
384-
<_ as AsRef<str>>::as_ref(&name.common_name().unwrap().unwrap()),
384+
name.common_name().unwrap().unwrap().value(),
385385
"OQFAvDNDWs.google.com"
386386
);
387387

@@ -391,22 +391,16 @@ fn access_attributes() {
391391
);
392392

393393
assert_eq!(
394-
<_ as AsRef<str>>::as_ref(&name.state_or_province().unwrap().unwrap()),
394+
name.state_or_province().unwrap().unwrap().value(),
395395
"California"
396396
);
397397

398-
assert_eq!(
399-
<_ as AsRef<str>>::as_ref(&name.locality().unwrap().unwrap()),
400-
"Mountain View"
401-
);
398+
assert_eq!(name.locality().unwrap().unwrap().value(), "Mountain View");
402399

403-
assert_eq!(
404-
<_ as AsRef<str>>::as_ref(&name.organization().unwrap().unwrap()),
405-
"Google LLC"
406-
);
400+
assert_eq!(name.organization().unwrap().unwrap().value(), "Google LLC");
407401

408402
assert_eq!(
409-
<_ as AsRef<str>>::as_ref(&name.organization_unit().unwrap().unwrap()),
403+
name.organization_unit().unwrap().unwrap().value(),
410404
"management:ds.group.3891111"
411405
);
412406

0 commit comments

Comments
 (0)