final static functions

This commit is contained in:
NikVolf 2016-03-29 22:29:43 +03:00
parent 34f6c1f2f1
commit 579d2b1f02
2 changed files with 13 additions and 15 deletions

View File

@ -431,6 +431,18 @@ fn push_proxy_implementation(
let implement = quote_item!(cx,
impl<S> ServiceProxy<S> where S: ::ipc::IpcSocket {
pub fn new(socket: S) -> ServiceProxy<S> {
ServiceProxy {
socket: ::std::cell::RefCell::new(socket),
phantom: ::std::marker::PhantomData,
}
}
#[cfg(test)]
pub fn socket(&self) -> &::std::cell::RefCell<S> {
&self.socket
}
$items
}).unwrap();

View File

@ -36,21 +36,7 @@ impl Service {
}
}
impl<S: ::ipc::IpcSocket> ServiceProxy<S> {
pub fn new(socket: S) -> ServiceProxy<S> {
ServiceProxy {
socket: ::std::cell::RefCell::new(socket),
phantom: ::std::marker::PhantomData,
}
}
#[cfg(test)]
pub fn socket(&self) -> &::std::cell::RefCell<S> {
&self.socket
}
}
impl Service {
impl Service {
pub fn new() -> Service {
Service {
commits: RwLock::new(0usize),