From 89b0e6e12ba2fb24ec0e6655a1130c16eb8d1745 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Sat, 14 Jun 2014 11:03:34 -0700 Subject: Register new snapshots --- src/libnative/io/file_unix.rs | 4 ++-- src/libnative/io/file_win32.rs | 4 ++-- src/libnative/io/mod.rs | 50 ++++++++++++++++++++--------------------- src/libnative/io/net.rs | 16 ++++++------- src/libnative/io/pipe_unix.rs | 12 +++++----- src/libnative/io/pipe_win32.rs | 12 +++++----- src/libnative/io/timer_unix.rs | 6 ++--- src/libnative/io/timer_win32.rs | 6 ++--- 8 files changed, 55 insertions(+), 55 deletions(-) (limited to 'src/libnative') diff --git a/src/libnative/io/file_unix.rs b/src/libnative/io/file_unix.rs index fda9b7b1932..f0ab77f6e40 100644 --- a/src/libnative/io/file_unix.rs +++ b/src/libnative/io/file_unix.rs @@ -167,8 +167,8 @@ impl rtio::RtioPipe for FileDesc { fn write(&mut self, buf: &[u8]) -> IoResult<()> { self.inner_write(buf) } - fn clone(&self) -> Box { - box FileDesc { inner: self.inner.clone() } as Box + fn clone(&self) -> Box { + box FileDesc { inner: self.inner.clone() } as Box } // Only supported on named pipes currently. Note that this doesn't have an diff --git a/src/libnative/io/file_win32.rs b/src/libnative/io/file_win32.rs index 5ace8e347c6..41ef5e31a91 100644 --- a/src/libnative/io/file_win32.rs +++ b/src/libnative/io/file_win32.rs @@ -201,8 +201,8 @@ impl rtio::RtioPipe for FileDesc { fn write(&mut self, buf: &[u8]) -> IoResult<()> { self.inner_write(buf) } - fn clone(&self) -> Box { - box FileDesc { inner: self.inner.clone() } as Box + fn clone(&self) -> Box { + box FileDesc { inner: self.inner.clone() } as Box } // Only supported on named pipes currently. Note that this doesn't have an diff --git a/src/libnative/io/mod.rs b/src/libnative/io/mod.rs index 4158db7bb8e..bf52c980d3a 100644 --- a/src/libnative/io/mod.rs +++ b/src/libnative/io/mod.rs @@ -166,34 +166,34 @@ impl rtio::IoFactory for IoFactory { // networking fn tcp_connect(&mut self, addr: rtio::SocketAddr, timeout: Option) - -> IoResult> + -> IoResult> { net::TcpStream::connect(addr, timeout).map(|s| { - box s as Box + box s as Box }) } fn tcp_bind(&mut self, addr: rtio::SocketAddr) - -> IoResult> { + -> IoResult> { net::TcpListener::bind(addr).map(|s| { - box s as Box + box s as Box }) } fn udp_bind(&mut self, addr: rtio::SocketAddr) - -> IoResult> { + -> IoResult> { net::UdpSocket::bind(addr).map(|u| { - box u as Box + box u as Box }) } fn unix_bind(&mut self, path: &CString) - -> IoResult> { + -> IoResult> { pipe::UnixListener::bind(path).map(|s| { - box s as Box + box s as Box }) } fn unix_connect(&mut self, path: &CString, - timeout: Option) -> IoResult> { + timeout: Option) -> IoResult> { pipe::UnixStream::connect(path, timeout).map(|s| { - box s as Box + box s as Box }) } fn get_host_addresses(&mut self, host: Option<&str>, servname: Option<&str>, @@ -205,18 +205,18 @@ impl rtio::IoFactory for IoFactory { // filesystem operations fn fs_from_raw_fd(&mut self, fd: c_int, close: rtio::CloseBehavior) - -> Box { + -> Box { let close = match close { rtio::CloseSynchronously | rtio::CloseAsynchronously => true, rtio::DontClose => false }; - box file::FileDesc::new(fd, close) as Box + box file::FileDesc::new(fd, close) as Box } fn fs_open(&mut self, path: &CString, fm: rtio::FileMode, fa: rtio::FileAccess) - -> IoResult> + -> IoResult> { - file::open(path, fm, fa).map(|fd| box fd as Box) + file::open(path, fm, fa).map(|fd| box fd as Box) } fn fs_unlink(&mut self, path: &CString) -> IoResult<()> { file::unlink(path) @@ -260,31 +260,31 @@ impl rtio::IoFactory for IoFactory { } // misc - fn timer_init(&mut self) -> IoResult> { - timer::Timer::new().map(|t| box t as Box) + fn timer_init(&mut self) -> IoResult> { + timer::Timer::new().map(|t| box t as Box) } fn spawn(&mut self, cfg: rtio::ProcessConfig) - -> IoResult<(Box, - Vec>>)> { + -> IoResult<(Box, + Vec>>)> { process::Process::spawn(cfg).map(|(p, io)| { - (box p as Box, + (box p as Box, io.move_iter().map(|p| p.map(|p| { - box p as Box + box p as Box })).collect()) }) } fn kill(&mut self, pid: libc::pid_t, signum: int) -> IoResult<()> { process::Process::kill(pid, signum) } - fn pipe_open(&mut self, fd: c_int) -> IoResult> { - Ok(box file::FileDesc::new(fd, true) as Box) + fn pipe_open(&mut self, fd: c_int) -> IoResult> { + Ok(box file::FileDesc::new(fd, true) as Box) } fn tty_open(&mut self, fd: c_int, _readable: bool) - -> IoResult> { + -> IoResult> { #[cfg(unix)] use ERROR = libc::ENOTTY; #[cfg(windows)] use ERROR = libc::ERROR_INVALID_HANDLE; if unsafe { libc::isatty(fd) } != 0 { - Ok(box file::FileDesc::new(fd, true) as Box) + Ok(box file::FileDesc::new(fd, true) as Box) } else { Err(IoError { code: ERROR as uint, @@ -294,7 +294,7 @@ impl rtio::IoFactory for IoFactory { } } fn signal(&mut self, _signal: int, _cb: Box) - -> IoResult> { + -> IoResult> { Err(unimpl()) } } diff --git a/src/libnative/io/net.rs b/src/libnative/io/net.rs index 1c33114dc71..e0872d4eb76 100644 --- a/src/libnative/io/net.rs +++ b/src/libnative/io/net.rs @@ -396,12 +396,12 @@ impl rtio::RtioTcpStream for TcpStream { self.set_keepalive(None) } - fn clone(&self) -> Box { + fn clone(&self) -> Box { box TcpStream { inner: self.inner.clone(), read_deadline: 0, write_deadline: 0, - } as Box + } as Box } fn close_write(&mut self) -> IoResult<()> { @@ -483,9 +483,9 @@ impl TcpListener { } impl rtio::RtioTcpListener for TcpListener { - fn listen(~self) -> IoResult> { + fn listen(~self) -> IoResult> { self.native_listen(128).map(|a| { - box a as Box + box a as Box }) } } @@ -532,8 +532,8 @@ impl rtio::RtioSocket for TcpAcceptor { } impl rtio::RtioTcpAcceptor for TcpAcceptor { - fn accept(&mut self) -> IoResult> { - self.native_accept().map(|s| box s as Box) + fn accept(&mut self) -> IoResult> { + self.native_accept().map(|s| box s as Box) } fn accept_simultaneously(&mut self) -> IoResult<()> { Ok(()) } @@ -719,12 +719,12 @@ impl rtio::RtioUdpSocket for UdpSocket { self.set_broadcast(false) } - fn clone(&self) -> Box { + fn clone(&self) -> Box { box UdpSocket { inner: self.inner.clone(), read_deadline: 0, write_deadline: 0, - } as Box + } as Box } fn set_timeout(&mut self, timeout: Option) { diff --git a/src/libnative/io/pipe_unix.rs b/src/libnative/io/pipe_unix.rs index 1458b475ae9..db0d1743c72 100644 --- a/src/libnative/io/pipe_unix.rs +++ b/src/libnative/io/pipe_unix.rs @@ -179,8 +179,8 @@ impl rtio::RtioPipe for UnixStream { } } - fn clone(&self) -> Box { - box UnixStream::new(self.inner.clone()) as Box + fn clone(&self) -> Box { + box UnixStream::new(self.inner.clone()) as Box } fn close_write(&mut self) -> IoResult<()> { @@ -229,9 +229,9 @@ impl UnixListener { } impl rtio::RtioUnixListener for UnixListener { - fn listen(~self) -> IoResult> { + fn listen(~self) -> IoResult> { self.native_listen(128).map(|a| { - box a as Box + box a as Box }) } } @@ -264,8 +264,8 @@ impl UnixAcceptor { } impl rtio::RtioUnixAcceptor for UnixAcceptor { - fn accept(&mut self) -> IoResult> { - self.native_accept().map(|s| box s as Box) + fn accept(&mut self) -> IoResult> { + self.native_accept().map(|s| box s as Box) } fn set_timeout(&mut self, timeout: Option) { self.deadline = timeout.map(|a| ::io::timer::now() + a).unwrap_or(0); diff --git a/src/libnative/io/pipe_win32.rs b/src/libnative/io/pipe_win32.rs index b097bde2ad8..5d9ddb1f59c 100644 --- a/src/libnative/io/pipe_win32.rs +++ b/src/libnative/io/pipe_win32.rs @@ -496,14 +496,14 @@ impl rtio::RtioPipe for UnixStream { Ok(()) } - fn clone(&self) -> Box { + fn clone(&self) -> Box { box UnixStream { inner: self.inner.clone(), read: None, write: None, read_deadline: 0, write_deadline: 0, - } as Box + } as Box } fn close_read(&mut self) -> IoResult<()> { @@ -588,9 +588,9 @@ impl Drop for UnixListener { } impl rtio::RtioUnixListener for UnixListener { - fn listen(~self) -> IoResult> { + fn listen(~self) -> IoResult> { self.native_listen().map(|a| { - box a as Box + box a as Box }) } } @@ -702,8 +702,8 @@ impl UnixAcceptor { } impl rtio::RtioUnixAcceptor for UnixAcceptor { - fn accept(&mut self) -> IoResult> { - self.native_accept().map(|s| box s as Box) + fn accept(&mut self) -> IoResult> { + self.native_accept().map(|s| box s as Box) } fn set_timeout(&mut self, timeout: Option) { self.deadline = timeout.map(|i| i + ::io::timer::now()).unwrap_or(0); diff --git a/src/libnative/io/timer_unix.rs b/src/libnative/io/timer_unix.rs index 11f9c4b3d8c..ab993997c85 100644 --- a/src/libnative/io/timer_unix.rs +++ b/src/libnative/io/timer_unix.rs @@ -67,7 +67,7 @@ pub struct Timer { } struct Inner { - cb: Option>, + cb: Option>, interval: u64, repeat: bool, target: u64, @@ -251,7 +251,7 @@ impl rtio::RtioTimer for Timer { Timer::sleep(msecs); } - fn oneshot(&mut self, msecs: u64, cb: Box) { + fn oneshot(&mut self, msecs: u64, cb: Box) { let now = now(); let mut inner = self.inner(); @@ -263,7 +263,7 @@ impl rtio::RtioTimer for Timer { unsafe { HELPER.send(NewTimer(inner)); } } - fn period(&mut self, msecs: u64, cb: Box) { + fn period(&mut self, msecs: u64, cb: Box) { let now = now(); let mut inner = self.inner(); diff --git a/src/libnative/io/timer_win32.rs b/src/libnative/io/timer_win32.rs index d175060dd98..9be09c6de07 100644 --- a/src/libnative/io/timer_win32.rs +++ b/src/libnative/io/timer_win32.rs @@ -36,7 +36,7 @@ pub struct Timer { } pub enum Req { - NewTimer(libc::HANDLE, Box, bool), + NewTimer(libc::HANDLE, Box, bool), RemoveTimer(libc::HANDLE, Sender<()>), } @@ -148,7 +148,7 @@ impl rtio::RtioTimer for Timer { let _ = unsafe { imp::WaitForSingleObject(self.obj, libc::INFINITE) }; } - fn oneshot(&mut self, msecs: u64, cb: Box) { + fn oneshot(&mut self, msecs: u64, cb: Box) { self.remove(); // see above for the calculation @@ -162,7 +162,7 @@ impl rtio::RtioTimer for Timer { self.on_worker = true; } - fn period(&mut self, msecs: u64, cb: Box) { + fn period(&mut self, msecs: u64, cb: Box) { self.remove(); // see above for the calculation -- cgit 1.4.1-3-g733a5