Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
briansmith committed Mar 23, 2020
1 parent 418cad8 commit 9f4ecfc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ where
/// This is an alias for `DnsName<&'a [u8]>`.
pub type DnsNameRef<'a> = DnsName<&'a [u8]>;

/// An owned `DnsName`
/// An owned `DnsName`.
///
/// This is an alias for `DnsName<Box<[u8]>>`.
#[cfg(feature = "std")]
pub type DnsNameBox = DnsName<Box<[u8]>>;

/// An error indicating that a `DnsName` could not built because the input
Expand Down Expand Up @@ -126,10 +127,9 @@ impl<B> DnsName<B>
/// `ExactSizeIterator` and `DoubleEndedIterator`.
///
/// ```
/// # #![cfg(feature = "std")]
/// # use std::string::String;
/// use std::iter::FromIterator;
/// # #[cfg(feature = "std")]
/// fn string_from_dns_name<B>(dns_name: webpki::DnsName<B>) -> String where B: AsRef<[u8]> {
/// use std::iter::FromIterator;
/// String::from_iter(dns_name.punycode_lowercase_bytes().map(char::from))
/// }
/// ```
Expand Down
5 changes: 4 additions & 1 deletion src/webpki.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ pub mod trust_anchor_util;
mod verify_cert;

pub use error::Error;
pub use name::{DnsName, DnsNameBox, DnsNameRef, InvalidDnsNameError};
pub use name::{DnsName, DnsNameRef, InvalidDnsNameError};

#[cfg(feature = "std")]
pub use name::DnsNameBox;

pub use signed_data::{
SignatureAlgorithm, ECDSA_P256_SHA256, ECDSA_P256_SHA384, ECDSA_P384_SHA256, ECDSA_P384_SHA384,
Expand Down
4 changes: 3 additions & 1 deletion tests/dns_name_tests.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2014-2017 Brian Smith.

use webpki::{DnsName, DnsNameRef, DnsNameBox};
use webpki::{DnsName, DnsNameRef};

// (name, is_valid)
static DNS_NAME_VALIDITY: &[(&[u8], bool)] = &[
Expand Down Expand Up @@ -484,6 +484,8 @@ fn test_dns_name_eq_case() {
#[cfg(feature = "std")]
#[test]
fn test_dns_name_eq_various_types() {
use webpki::DnsNameBox;

for (expected_lowercase, input) in DNS_NAME_LOWERCASE_TEST_CASES {
let a: DnsNameRef = DnsName::try_from_punycode(*expected_lowercase).unwrap();
let b: DnsNameBox = DnsName::try_from_punycode(*input).unwrap().into_owned();
Expand Down

0 comments on commit 9f4ecfc

Please sign in to comment.