diff options
| author | bors <bors@rust-lang.org> | 2014-03-31 15:51:33 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-03-31 15:51:33 -0700 |
| commit | b8ef9fd9c9f642ce7b8aed82782a1ed745d08d64 (patch) | |
| tree | 1e66451d207e19694d62608a8e1724c71796dc00 /src/libstd/io | |
| parent | a7e057d402a345f547e67a326871621472d04035 (diff) | |
| parent | 37a3131640d0fa2633aa26db7f849d110250ce51 (diff) | |
| download | rust-b8ef9fd9c9f642ce7b8aed82782a1ed745d08d64.tar.gz rust-b8ef9fd9c9f642ce7b8aed82782a1ed745d08d64.zip | |
auto merge of #13184 : alexcrichton/rust/priv-fields, r=brson
This is an implementation of a portion of [RFC #4](https://github.com/rust-lang/rfcs/blob/master/active/0004-private-fields.md). This PR makes named struct fields private by default (as opposed to inherited by default). The only real meaty change is the first commit to `rustc`, all other commits are just fallout of that change. Summary of changes made: * Named fields are private by default *everywhere* * The `priv` keyword is now default-deny on named fields (done in a "lint" pass in privacy) Changes yet to be done (before the RFC is closed) * Change tuple structs to have private fields by default * Remove `priv` enum variants * Make `priv` a reserved keyword
Diffstat (limited to 'src/libstd/io')
| -rw-r--r-- | src/libstd/io/buffered.rs | 20 | ||||
| -rw-r--r-- | src/libstd/io/comm_adapters.rs | 10 | ||||
| -rw-r--r-- | src/libstd/io/extensions.rs | 2 | ||||
| -rw-r--r-- | src/libstd/io/fs.rs | 8 | ||||
| -rw-r--r-- | src/libstd/io/mem.rs | 16 | ||||
| -rw-r--r-- | src/libstd/io/mod.rs | 48 | ||||
| -rw-r--r-- | src/libstd/io/net/addrinfo.rs | 18 | ||||
| -rw-r--r-- | src/libstd/io/net/ip.rs | 4 | ||||
| -rw-r--r-- | src/libstd/io/net/tcp.rs | 8 | ||||
| -rw-r--r-- | src/libstd/io/net/udp.rs | 6 | ||||
| -rw-r--r-- | src/libstd/io/net/unix.rs | 6 | ||||
| -rw-r--r-- | src/libstd/io/pipe.rs | 2 | ||||
| -rw-r--r-- | src/libstd/io/process.rs | 40 | ||||
| -rw-r--r-- | src/libstd/io/signal.rs | 6 | ||||
| -rw-r--r-- | src/libstd/io/stdio.rs | 4 | ||||
| -rw-r--r-- | src/libstd/io/tempfile.rs | 2 | ||||
| -rw-r--r-- | src/libstd/io/timer.rs | 2 | ||||
| -rw-r--r-- | src/libstd/io/util.rs | 14 |
18 files changed, 106 insertions, 110 deletions
diff --git a/src/libstd/io/buffered.rs b/src/libstd/io/buffered.rs index fed47dfcff3..4da297a25fd 100644 --- a/src/libstd/io/buffered.rs +++ b/src/libstd/io/buffered.rs @@ -43,10 +43,10 @@ use vec::Vec; /// } /// ``` pub struct BufferedReader<R> { - priv inner: R, - priv buf: Vec<u8>, - priv pos: uint, - priv cap: uint, + inner: R, + buf: Vec<u8>, + pos: uint, + cap: uint, } impl<R: Reader> BufferedReader<R> { @@ -135,9 +135,9 @@ impl<R: Reader> Reader for BufferedReader<R> { /// writer.flush(); /// ``` pub struct BufferedWriter<W> { - priv inner: Option<W>, - priv buf: Vec<u8>, - priv pos: uint + inner: Option<W>, + buf: Vec<u8>, + pos: uint } impl<W: Writer> BufferedWriter<W> { @@ -220,7 +220,7 @@ impl<W: Writer> Drop for BufferedWriter<W> { /// /// This writer will be flushed when it is dropped. pub struct LineBufferedWriter<W> { - priv inner: BufferedWriter<W>, + inner: BufferedWriter<W>, } impl<W: Writer> LineBufferedWriter<W> { @@ -303,7 +303,7 @@ impl<W: Reader> Reader for InternalBufferedWriter<W> { /// } /// ``` pub struct BufferedStream<S> { - priv inner: BufferedReader<InternalBufferedWriter<S>> + inner: BufferedReader<InternalBufferedWriter<S>> } impl<S: Stream> BufferedStream<S> { @@ -391,7 +391,7 @@ mod test { /// A dummy reader intended at testing short-reads propagation. pub struct ShortReader { - priv lengths: ~[uint], + lengths: ~[uint], } impl Reader for ShortReader { diff --git a/src/libstd/io/comm_adapters.rs b/src/libstd/io/comm_adapters.rs index 075c65e04be..06e02072135 100644 --- a/src/libstd/io/comm_adapters.rs +++ b/src/libstd/io/comm_adapters.rs @@ -36,10 +36,10 @@ use slice::{bytes, CloneableVector, MutableVector, ImmutableVector}; /// } /// ``` pub struct ChanReader { - priv buf: Option<~[u8]>, // A buffer of bytes received but not consumed. - priv pos: uint, // How many of the buffered bytes have already be consumed. - priv rx: Receiver<~[u8]>, // The rx to pull data from. - priv closed: bool, // Whether the pipe this rx connects to has been closed. + buf: Option<~[u8]>, // A buffer of bytes received but not consumed. + pos: uint, // How many of the buffered bytes have already be consumed. + rx: Receiver<~[u8]>, // The rx to pull data from. + closed: bool, // Whether the pipe this rx connects to has been closed. } impl ChanReader { @@ -98,7 +98,7 @@ impl Reader for ChanReader { /// writer.write("hello, world".as_bytes()); /// ``` pub struct ChanWriter { - priv tx: Sender<~[u8]>, + tx: Sender<~[u8]>, } impl ChanWriter { diff --git a/src/libstd/io/extensions.rs b/src/libstd/io/extensions.rs index 0275d9ba8d9..a9fe3be585c 100644 --- a/src/libstd/io/extensions.rs +++ b/src/libstd/io/extensions.rs @@ -38,7 +38,7 @@ use ptr::RawPtr; /// Any error other than `EndOfFile` that is produced by the underlying Reader /// is returned by the iterator and should be handled by the caller. pub struct Bytes<'r, T> { - priv reader: &'r mut T, + reader: &'r mut T, } impl<'r, R: Reader> Bytes<'r, R> { diff --git a/src/libstd/io/fs.rs b/src/libstd/io/fs.rs index 020f493e24b..b6efdfad9d3 100644 --- a/src/libstd/io/fs.rs +++ b/src/libstd/io/fs.rs @@ -78,9 +78,9 @@ use vec::Vec; /// configured at creation time, via the `FileAccess` parameter to /// `File::open_mode()`. pub struct File { - priv fd: ~RtioFileStream:Send, - priv path: Path, - priv last_nread: int, + fd: ~RtioFileStream:Send, + path: Path, + last_nread: int, } impl File { @@ -498,7 +498,7 @@ pub fn walk_dir(path: &Path) -> IoResult<Directories> { /// An iterator which walks over a directory pub struct Directories { - priv stack: ~[Path], + stack: ~[Path], } impl Iterator<Path> for Directories { diff --git a/src/libstd/io/mem.rs b/src/libstd/io/mem.rs index 7ae717cfccf..e9c6b5b01da 100644 --- a/src/libstd/io/mem.rs +++ b/src/libstd/io/mem.rs @@ -52,8 +52,8 @@ fn combine(seek: SeekStyle, cur: uint, end: uint, offset: i64) -> IoResult<u64> /// assert_eq!(w.unwrap(), ~[0, 1, 2]); /// ``` pub struct MemWriter { - priv buf: ~[u8], - priv pos: uint, + buf: ~[u8], + pos: uint, } impl MemWriter { @@ -132,8 +132,8 @@ impl Seek for MemWriter { /// assert_eq!(r.read_to_end().unwrap(), ~[0, 1, 2]); /// ``` pub struct MemReader { - priv buf: ~[u8], - priv pos: uint + buf: ~[u8], + pos: uint } impl MemReader { @@ -219,8 +219,8 @@ impl Buffer for MemReader { /// assert!(buf == [0, 1, 2, 0]); /// ``` pub struct BufWriter<'a> { - priv buf: &'a mut [u8], - priv pos: uint + buf: &'a mut [u8], + pos: uint } impl<'a> BufWriter<'a> { @@ -275,8 +275,8 @@ impl<'a> Seek for BufWriter<'a> { /// assert_eq!(r.read_to_end().unwrap(), ~[0, 1, 2, 3]); /// ``` pub struct BufReader<'a> { - priv buf: &'a [u8], - priv pos: uint + buf: &'a [u8], + pos: uint } impl<'a> BufReader<'a> { diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index c1833e6b116..50f8b0b28c4 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -283,11 +283,11 @@ pub type IoResult<T> = Result<T, IoError>; pub struct IoError { /// An enumeration which can be matched against for determining the flavor /// of error. - kind: IoErrorKind, + pub kind: IoErrorKind, /// A human-readable description about the error - desc: &'static str, + pub desc: &'static str, /// Detailed information about this error, not always available - detail: Option<~str> + pub detail: Option<~str> } impl fmt::Show for IoError { @@ -1023,7 +1023,7 @@ impl<T: Reader + Writer> Stream for T {} /// Any error other than `EndOfFile` that is produced by the underlying Reader /// is returned by the iterator and should be handled by the caller. pub struct Lines<'r, T> { - priv buffer: &'r mut T, + buffer: &'r mut T, } impl<'r, T: Buffer> Iterator<IoResult<~str>> for Lines<'r, T> { @@ -1050,7 +1050,7 @@ impl<'r, T: Buffer> Iterator<IoResult<~str>> for Lines<'r, T> { /// Any error other than `EndOfFile` that is produced by the underlying Reader /// is returned by the iterator and should be handled by the caller. pub struct Chars<'r, T> { - priv buffer: &'r mut T + buffer: &'r mut T } impl<'r, T: Buffer> Iterator<IoResult<char>> for Chars<'r, T> { @@ -1290,7 +1290,7 @@ pub trait Acceptor<T> { /// connection attempt was successful. A successful connection will be wrapped /// in `Ok`. A failed connection is represented as an `Err`. pub struct IncomingConnections<'a, A> { - priv inc: &'a mut A, + inc: &'a mut A, } impl<'a, T, A: Acceptor<T>> Iterator<IoResult<T>> for IncomingConnections<'a, A> { @@ -1389,13 +1389,13 @@ pub enum FileType { #[deriving(Hash)] pub struct FileStat { /// The path that this stat structure is describing - path: Path, + pub path: Path, /// The size of the file, in bytes - size: u64, + pub size: u64, /// The kind of file this path points to (directory, file, pipe, etc.) - kind: FileType, + pub kind: FileType, /// The file permissions currently on the file - perm: FilePermission, + pub perm: FilePermission, // FIXME(#10301): These time fields are pretty useless without an actual // time representation, what are the milliseconds relative @@ -1403,13 +1403,13 @@ pub struct FileStat { /// The time that the file was created at, in platform-dependent /// milliseconds - created: u64, + pub created: u64, /// The time that this file was last modified, in platform-dependent /// milliseconds - modified: u64, + pub modified: u64, /// The time that this file was last accessed, in platform-dependent /// milliseconds - accessed: u64, + pub accessed: u64, /// Information returned by stat() which is not guaranteed to be /// platform-independent. This information may be useful on some platforms, @@ -1419,7 +1419,7 @@ pub struct FileStat { /// Usage of this field is discouraged, but if access is desired then the /// fields are located here. #[unstable] - unstable: UnstableFileStat, + pub unstable: UnstableFileStat, } /// This structure represents all of the possible information which can be @@ -1430,25 +1430,25 @@ pub struct FileStat { #[deriving(Hash)] pub struct UnstableFileStat { /// The ID of the device containing the file. - device: u64, + pub device: u64, /// The file serial number. - inode: u64, + pub inode: u64, /// The device ID. - rdev: u64, + pub rdev: u64, /// The number of hard links to this file. - nlink: u64, + pub nlink: u64, /// The user ID of the file. - uid: u64, + pub uid: u64, /// The group ID of the file. - gid: u64, + pub gid: u64, /// The optimal block size for I/O. - blksize: u64, + pub blksize: u64, /// The blocks allocated for this file. - blocks: u64, + pub blocks: u64, /// User-defined flags for the file. - flags: u64, + pub flags: u64, /// The file generation number. - gen: u64, + pub gen: u64, } /// A set of permissions for a file or directory is represented by a set of diff --git a/src/libstd/io/net/addrinfo.rs b/src/libstd/io/net/addrinfo.rs index bf573bfaed8..4006665e886 100644 --- a/src/libstd/io/net/addrinfo.rs +++ b/src/libstd/io/net/addrinfo.rs @@ -57,18 +57,18 @@ pub enum Protocol { /// For details on these fields, see their corresponding definitions via /// `man -s 3 getaddrinfo` pub struct Hint { - family: uint, - socktype: Option<SocketType>, - protocol: Option<Protocol>, - flags: uint, + pub family: uint, + pub socktype: Option<SocketType>, + pub protocol: Option<Protocol>, + pub flags: uint, } pub struct Info { - address: SocketAddr, - family: uint, - socktype: Option<SocketType>, - protocol: Option<Protocol>, - flags: uint, + pub address: SocketAddr, + pub family: uint, + pub socktype: Option<SocketType>, + pub protocol: Option<Protocol>, + pub flags: uint, } /// Easy name resolution. Given a hostname, returns the list of IP addresses for diff --git a/src/libstd/io/net/ip.rs b/src/libstd/io/net/ip.rs index 8cb205ab67e..10e1ffacd95 100644 --- a/src/libstd/io/net/ip.rs +++ b/src/libstd/io/net/ip.rs @@ -58,8 +58,8 @@ impl fmt::Show for IpAddr { #[deriving(Eq, TotalEq, Clone, Hash)] pub struct SocketAddr { - ip: IpAddr, - port: Port, + pub ip: IpAddr, + pub port: Port, } impl fmt::Show for SocketAddr { diff --git a/src/libstd/io/net/tcp.rs b/src/libstd/io/net/tcp.rs index 61943eb3d6f..b4dcd204479 100644 --- a/src/libstd/io/net/tcp.rs +++ b/src/libstd/io/net/tcp.rs @@ -17,8 +17,6 @@ //! A TCP connection implements the `Reader` and `Writer` traits, while the TCP //! listener (socket server) implements the `Listener` and `Acceptor` traits. -#![deny(missing_doc)] - use clone::Clone; use io::IoResult; use io::net::ip::SocketAddr; @@ -46,7 +44,7 @@ use rt::rtio::{RtioTcpAcceptor, RtioTcpStream}; /// drop(stream); // close the connection /// ``` pub struct TcpStream { - priv obj: ~RtioTcpStream:Send + obj: ~RtioTcpStream:Send } impl TcpStream { @@ -128,7 +126,7 @@ impl Writer for TcpStream { /// # } /// ``` pub struct TcpListener { - priv obj: ~RtioTcpListener:Send + obj: ~RtioTcpListener:Send } impl TcpListener { @@ -161,7 +159,7 @@ impl Listener<TcpStream, TcpAcceptor> for TcpListener { /// a `TcpListener`'s `listen` method, and this object can be used to accept new /// `TcpStream` instances. pub struct TcpAcceptor { - priv obj: ~RtioTcpAcceptor:Send + obj: ~RtioTcpAcceptor:Send } impl Acceptor<TcpStream> for TcpAcceptor { diff --git a/src/libstd/io/net/udp.rs b/src/libstd/io/net/udp.rs index 8169fc1a917..8dd59e859b8 100644 --- a/src/libstd/io/net/udp.rs +++ b/src/libstd/io/net/udp.rs @@ -54,7 +54,7 @@ use rt::rtio::{RtioSocket, RtioUdpSocket, IoFactory, LocalIo}; /// drop(socket); // close the socket /// ``` pub struct UdpSocket { - priv obj: ~RtioUdpSocket:Send + obj: ~RtioUdpSocket:Send } impl UdpSocket { @@ -115,8 +115,8 @@ impl Clone for UdpSocket { /// A type that allows convenient usage of a UDP stream connected to one /// address via the `Reader` and `Writer` traits. pub struct UdpStream { - priv socket: UdpSocket, - priv connected_to: SocketAddr + socket: UdpSocket, + connected_to: SocketAddr } impl UdpStream { diff --git a/src/libstd/io/net/unix.rs b/src/libstd/io/net/unix.rs index 73bb6b56298..0d64a7b141e 100644 --- a/src/libstd/io/net/unix.rs +++ b/src/libstd/io/net/unix.rs @@ -36,7 +36,7 @@ use rt::rtio::{RtioUnixAcceptor, RtioPipe}; /// A stream which communicates over a named pipe. pub struct UnixStream { - priv obj: PipeStream, + obj: PipeStream, } impl UnixStream { @@ -83,7 +83,7 @@ impl Writer for UnixStream { /// A value that can listen for incoming named pipe connection requests. pub struct UnixListener { /// The internal, opaque runtime Unix listener. - priv obj: ~RtioUnixListener:Send, + obj: ~RtioUnixListener:Send, } impl UnixListener { @@ -125,7 +125,7 @@ impl Listener<UnixStream, UnixAcceptor> for UnixListener { /// A value that can accept named pipe connections, returned from `listen()`. pub struct UnixAcceptor { /// The internal, opaque runtime Unix acceptor. - priv obj: ~RtioUnixAcceptor:Send, + obj: ~RtioUnixAcceptor:Send, } impl Acceptor<UnixStream> for UnixAcceptor { diff --git a/src/libstd/io/pipe.rs b/src/libstd/io/pipe.rs index 43b53ca95dc..75ec3d8614e 100644 --- a/src/libstd/io/pipe.rs +++ b/src/libstd/io/pipe.rs @@ -23,7 +23,7 @@ use rt::rtio::{RtioPipe, LocalIo}; /// A synchronous, in-memory pipe. pub struct PipeStream { /// The internal, opaque runtime pipe object. - priv obj: ~RtioPipe:Send, + obj: ~RtioPipe:Send, } impl PipeStream { diff --git a/src/libstd/io/process.rs b/src/libstd/io/process.rs index 0ce35018a9c..1f067021825 100644 --- a/src/libstd/io/process.rs +++ b/src/libstd/io/process.rs @@ -10,8 +10,6 @@ //! Bindings for executing child processes -#![deny(missing_doc)] - use prelude::*; use fmt; @@ -53,23 +51,23 @@ use rt::rtio::{RtioProcess, IoFactory, LocalIo}; /// assert!(child.wait().success()); /// ``` pub struct Process { - priv handle: ~RtioProcess:Send, + handle: ~RtioProcess:Send, /// Handle to the child's stdin, if the `stdin` field of this process's /// `ProcessConfig` was `CreatePipe`. By default, this handle is `Some`. - stdin: Option<io::PipeStream>, + pub stdin: Option<io::PipeStream>, /// Handle to the child's stdout, if the `stdout` field of this process's /// `ProcessConfig` was `CreatePipe`. By default, this handle is `Some`. - stdout: Option<io::PipeStream>, + pub stdout: Option<io::PipeStream>, /// Handle to the child's stderr, if the `stderr` field of this process's /// `ProcessConfig` was `CreatePipe`. By default, this handle is `Some`. - stderr: Option<io::PipeStream>, + pub stderr: Option<io::PipeStream>, /// Extra I/O handles as configured by the original `ProcessConfig` when /// this process was created. This is by default empty. - extra_io: ~[Option<io::PipeStream>], + pub extra_io: ~[Option<io::PipeStream>], } /// This configuration describes how a new process should be spawned. A blank @@ -88,33 +86,33 @@ pub struct Process { /// ``` pub struct ProcessConfig<'a> { /// Path to the program to run - program: &'a str, + pub program: &'a str, /// Arguments to pass to the program (doesn't include the program itself) - args: &'a [~str], + pub args: &'a [~str], /// Optional environment to specify for the program. If this is None, then /// it will inherit the current process's environment. - env: Option<&'a [(~str, ~str)]>, + pub env: Option<&'a [(~str, ~str)]>, /// Optional working directory for the new process. If this is None, then /// the current directory of the running process is inherited. - cwd: Option<&'a Path>, + pub cwd: Option<&'a Path>, /// Configuration for the child process's stdin handle (file descriptor 0). /// This field defaults to `CreatePipe(true, false)` so the input can be /// written to. - stdin: StdioContainer, + pub stdin: StdioContainer, /// Configuration for the child process's stdout handle (file descriptor 1). /// This field defaults to `CreatePipe(false, true)` so the output can be /// collected. - stdout: StdioContainer, + pub stdout: StdioContainer, /// Configuration for the child process's stdout handle (file descriptor 2). /// This field defaults to `CreatePipe(false, true)` so the output can be /// collected. - stderr: StdioContainer, + pub stderr: StdioContainer, /// Any number of streams/file descriptors/pipes may be attached to this /// process. This list enumerates the file descriptors and such for the @@ -122,31 +120,31 @@ pub struct ProcessConfig<'a> { /// 3 and go to the length of this array. The first three file descriptors /// (stdin/stdout/stderr) are configured with the `stdin`, `stdout`, and /// `stderr` fields. - extra_io: &'a [StdioContainer], + pub extra_io: &'a [StdioContainer], /// Sets the child process's user id. This translates to a `setuid` call in /// the child process. Setting this value on windows will cause the spawn to /// fail. Failure in the `setuid` call on unix will also cause the spawn to /// fail. - uid: Option<uint>, + pub uid: Option<uint>, /// Similar to `uid`, but sets the group id of the child process. This has /// the same semantics as the `uid` field. - gid: Option<uint>, + pub gid: Option<uint>, /// If true, the child process is spawned in a detached state. On unix, this /// means that the child is the leader of a new process group. - detach: bool, + pub detach: bool, } /// The output of a finished process. pub struct ProcessOutput { /// The status (exit code) of the process. - status: ProcessExit, + pub status: ProcessExit, /// The data that the process wrote to stdout. - output: ~[u8], + pub output: ~[u8], /// The data that the process wrote to stderr. - error: ~[u8], + pub error: ~[u8], } /// Describes what to do with a standard io stream for a child process. diff --git a/src/libstd/io/signal.rs b/src/libstd/io/signal.rs index d6700fda23d..494cc6f6b02 100644 --- a/src/libstd/io/signal.rs +++ b/src/libstd/io/signal.rs @@ -81,15 +81,15 @@ pub enum Signum { /// ``` pub struct Listener { /// A map from signums to handles to keep the handles in memory - priv handles: ~[(Signum, ~RtioSignal)], + handles: ~[(Signum, ~RtioSignal)], /// This is where all the handles send signums, which are received by /// the clients from the receiver. - priv tx: Sender<Signum>, + tx: Sender<Signum>, /// Clients of Listener can `recv()` on this receiver. This is exposed to /// allow selection over it as well as manipulation of the receiver /// directly. - rx: Receiver<Signum>, + pub rx: Receiver<Signum>, } impl Listener { diff --git a/src/libstd/io/stdio.rs b/src/libstd/io/stdio.rs index e52df042561..ae98333ca96 100644 --- a/src/libstd/io/stdio.rs +++ b/src/libstd/io/stdio.rs @@ -293,7 +293,7 @@ pub fn println_args(fmt: &fmt::Arguments) { /// Representation of a reader of a standard input stream pub struct StdReader { - priv inner: StdSource + inner: StdSource } impl Reader for StdReader { @@ -322,7 +322,7 @@ impl Reader for StdReader { /// Representation of a writer to a standard output stream pub struct StdWriter { - priv inner: StdSource + inner: StdSource } impl StdWriter { diff --git a/src/libstd/io/tempfile.rs b/src/libstd/io/tempfile.rs index 34d6b19199a..4ff1c7faaec 100644 --- a/src/libstd/io/tempfile.rs +++ b/src/libstd/io/tempfile.rs @@ -24,7 +24,7 @@ use sync::atomics; /// A wrapper for a path to temporary directory implementing automatic /// scope-based deletion. pub struct TempDir { - priv path: Option<Path> + path: Option<Path> } impl TempDir { diff --git a/src/libstd/io/timer.rs b/src/libstd/io/timer.rs index 6840c418a9b..839fcab8f86 100644 --- a/src/libstd/io/timer.rs +++ b/src/libstd/io/timer.rs @@ -63,7 +63,7 @@ use rt::rtio::{IoFactory, LocalIo, RtioTimer}; /// # } /// ``` pub struct Timer { - priv obj: ~RtioTimer:Send, + obj: ~RtioTimer:Send, } /// Sleep the current task for `msecs` milliseconds. diff --git a/src/libstd/io/util.rs b/src/libstd/io/util.rs index 2df0dec2d13..a294ba17289 100644 --- a/src/libstd/io/util.rs +++ b/src/libstd/io/util.rs @@ -17,8 +17,8 @@ use slice::bytes::MutableByteVector; /// Wraps a `Reader`, limiting the number of bytes that can be read from it. pub struct LimitReader<R> { - priv limit: uint, - priv inner: R + limit: uint, + inner: R } impl<R: Reader> LimitReader<R> { @@ -85,7 +85,7 @@ impl Reader for NullReader { /// A `Writer` which multiplexes writes to a set of `Writers`. pub struct MultiWriter { - priv writers: ~[~Writer] + writers: ~[~Writer] } impl MultiWriter { @@ -118,8 +118,8 @@ impl Writer for MultiWriter { /// A `Reader` which chains input from multiple `Readers`, reading each to /// completion before moving onto the next. pub struct ChainedReader<I, R> { - priv readers: I, - priv cur_reader: Option<R>, + readers: I, + cur_reader: Option<R>, } impl<R: Reader, I: Iterator<R>> ChainedReader<I, R> { @@ -156,8 +156,8 @@ impl<R: Reader, I: Iterator<R>> Reader for ChainedReader<I, R> { /// A `Reader` which forwards input from another `Reader`, passing it along to /// a `Writer` as well. Similar to the `tee(1)` command. pub struct TeeReader<R, W> { - priv reader: R, - priv writer: W + reader: R, + writer: W, } impl<R: Reader, W: Writer> TeeReader<R, W> { |
