From 825117fd4c3c6bdd4fe3900000886fcb5388a3d9 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Tue, 12 Mar 2019 13:12:22 -0700 Subject: [PATCH] add Deref/DerefMut impls for Io --- actix-server-config/src/lib.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/actix-server-config/src/lib.rs b/actix-server-config/src/lib.rs index 6f8f3002..6eccaf4c 100644 --- a/actix-server-config/src/lib.rs +++ b/actix-server-config/src/lib.rs @@ -111,6 +111,20 @@ impl Io { } } +impl std::ops::Deref for Io { + type Target = T; + + fn deref(&self) -> &T { + &self.io + } +} + +impl std::ops::DerefMut for Io { + fn deref_mut(&mut self) -> &mut T { + &mut self.io + } +} + impl fmt::Debug for Io { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "Io {{{:?}}}", self.io)