From dcea5c252667c9b474b4d24270d417f9fefc7754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Tue, 30 Aug 2016 16:56:46 +0200 Subject: [PATCH] Adding proof --- dapps/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dapps/src/lib.rs b/dapps/src/lib.rs index 2beef0639..bc54b0f37 100644 --- a/dapps/src/lib.rs +++ b/dapps/src/lib.rs @@ -208,9 +208,10 @@ impl Server { *self.panic_handler.lock().unwrap() = Some(Box::new(handler)); } + #[cfg(test)] /// Returns address that this server is bound to. pub fn addr(&self) -> &SocketAddr { - self.server.as_ref().unwrap().addr() + self.server.as_ref().expect("server is always Some at the start; it's consumed only when object is dropped; qed").addr() } }