Skip to content

Commit

Permalink
IntoIterator on reference, too
Browse files Browse the repository at this point in the history
  • Loading branch information
kim committed Mar 11, 2020
1 parent 8cf8b5a commit 0166304
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions quinn-proto/src/crypto/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@ impl IntoIterator for CertificateChain {
}
}

impl<'a> IntoIterator for &'a CertificateChain {
type Item = &'a rustls::Certificate;
type IntoIter = std::slice::Iter<'a, rustls::Certificate>;

fn into_iter(self) -> Self::IntoIter {
self.certs.iter()
}
}

/// The private key of a TLS certificate to be used by a server
#[derive(Debug, Clone)]
pub struct PrivateKey {
Expand Down

0 comments on commit 0166304

Please sign in to comment.