From 54fd7a1df45eaa0ef6fb1cfab89013dbe9a7fb9f Mon Sep 17 00:00:00 2001 From: kazk Date: Fri, 6 Jan 2023 15:31:46 -0800 Subject: [PATCH] Make the field private --- src/common/sec_websocket_extensions.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/common/sec_websocket_extensions.rs b/src/common/sec_websocket_extensions.rs index 97b2c156..33be62bc 100644 --- a/src/common/sec_websocket_extensions.rs +++ b/src/common/sec_websocket_extensions.rs @@ -61,7 +61,7 @@ use {Error, Header, HeaderValue}; /// [RFC6455_11.3.2]: https://tools.ietf.org/html/rfc6455#section-11.3.2 /// [RFC7692_7]: https://tools.ietf.org/html/rfc7692#section-7 #[derive(Clone, Debug, Eq, PartialEq)] -pub struct SecWebsocketExtensions(pub Vec); +pub struct SecWebsocketExtensions(Vec); impl Header for SecWebsocketExtensions { fn name() -> &'static ::HeaderName { @@ -125,6 +125,12 @@ impl SecWebsocketExtensions { } } +impl From> for SecWebsocketExtensions { + fn from(extensions: Vec) -> SecWebsocketExtensions { + SecWebsocketExtensions(extensions) + } +} + impl TryFrom<&str> for SecWebsocketExtensions { type Error = Error;