diff --git a/ipc/codegen/src/codegen.rs b/ipc/codegen/src/codegen.rs index b6e823fde..621069cc2 100644 --- a/ipc/codegen/src/codegen.rs +++ b/ipc/codegen/src/codegen.rs @@ -431,6 +431,18 @@ fn push_proxy_implementation( let implement = quote_item!(cx, impl ServiceProxy where S: ::ipc::IpcSocket { + pub fn new(socket: S) -> ServiceProxy { + ServiceProxy { + socket: ::std::cell::RefCell::new(socket), + phantom: ::std::marker::PhantomData, + } + } + + #[cfg(test)] + pub fn socket(&self) -> &::std::cell::RefCell { + &self.socket + } + $items }).unwrap(); diff --git a/ipc/tests/service.rs.in b/ipc/tests/service.rs.in index b4545d320..9439e6508 100644 --- a/ipc/tests/service.rs.in +++ b/ipc/tests/service.rs.in @@ -36,21 +36,7 @@ impl Service { } } -impl ServiceProxy { - pub fn new(socket: S) -> ServiceProxy { - ServiceProxy { - socket: ::std::cell::RefCell::new(socket), - phantom: ::std::marker::PhantomData, - } - } - - #[cfg(test)] - pub fn socket(&self) -> &::std::cell::RefCell { - &self.socket - } -} - -impl Service { + impl Service { pub fn new() -> Service { Service { commits: RwLock::new(0usize),