From 0166304ecd849ba4224031a930ecc663973c13b4 Mon Sep 17 00:00:00 2001 From: Kim Altintop Date: Wed, 11 Mar 2020 23:26:43 +0100 Subject: [PATCH] IntoIterator on reference, too --- quinn-proto/src/crypto/types.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/quinn-proto/src/crypto/types.rs b/quinn-proto/src/crypto/types.rs index 3c3765e2a..4382b6ce9 100644 --- a/quinn-proto/src/crypto/types.rs +++ b/quinn-proto/src/crypto/types.rs @@ -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 {