Skip to content

Commit 7270fad

Browse files
committed
core::rt: Rename Closeable to Close, Seekable to Seek, blocking to native
1 parent e782e1f commit 7270fad

File tree

8 files changed

+21
-21
lines changed

8 files changed

+21
-21
lines changed

src/libcore/rt/io/file.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
use prelude::*;
1212
use super::misc::PathLike;
13-
use super::{Reader, Writer, Seekable, Closeable};
13+
use super::{Reader, Writer, Seek, Close};
1414
use super::{IoError, SeekStyle};
1515

1616
/// Open a file with the default FileMode and FileAccess
@@ -67,13 +67,13 @@ impl Writer for FileStream {
6767
fn flush(&mut self) { fail!() }
6868
}
6969

70-
impl Seekable for FileStream {
70+
impl Seek for FileStream {
7171
fn tell(&self) -> u64 { fail!() }
7272

7373
fn seek(&mut self, _pos: i64, _style: SeekStyle) { fail!() }
7474
}
7575

76-
impl Closeable for FileStream {
76+
impl Close for FileStream {
7777
fn close(&mut self) { fail!() }
7878
}
7979

src/libcore/rt/io/mem.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl Writer for MemWriter {
3434
fn flush(&mut self) { /* no-op */ }
3535
}
3636

37-
impl Seekable for MemWriter {
37+
impl Seek for MemWriter {
3838
fn tell(&self) -> u64 { fail!() }
3939

4040
fn seek(&mut self, _pos: i64, _style: SeekStyle) { fail!() }
@@ -82,7 +82,7 @@ impl Reader for MemReader {
8282
fn eof(&mut self) -> bool { fail!() }
8383
}
8484

85-
impl Seekable for MemReader {
85+
impl Seek for MemReader {
8686
fn tell(&self) -> u64 { fail!() }
8787

8888
fn seek(&mut self, _pos: i64, _style: SeekStyle) { fail!() }
@@ -131,7 +131,7 @@ impl<'self> Writer for BufWriter<'self> {
131131
fn flush(&mut self) { fail!() }
132132
}
133133

134-
impl<'self> Seekable for BufWriter<'self> {
134+
impl<'self> Seek for BufWriter<'self> {
135135
fn tell(&self) -> u64 { fail!() }
136136

137137
fn seek(&mut self, _pos: i64, _style: SeekStyle) { fail!() }
@@ -159,7 +159,7 @@ impl<'self> Reader for BufReader<'self> {
159159
fn eof(&mut self) -> bool { fail!() }
160160
}
161161

162-
impl<'self> Seekable for BufReader<'self> {
162+
impl<'self> Seek for BufReader<'self> {
163163
fn tell(&self) -> u64 { fail!() }
164164

165165
fn seek(&mut self, _pos: i64, _style: SeekStyle) { fail!() }

src/libcore/rt/io/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ mod util;
146146
mod misc;
147147

148148
/// Thread-blocking implementations
149-
pub mod blocking {
149+
pub mod native {
150150
/// Posix file I/O
151151
pub mod file;
152152
/// # XXX - implement this
@@ -233,12 +233,12 @@ pub trait Writer {
233233
///
234234
/// Any further operations performed on a closed resource will raise
235235
/// on `io_error`
236-
pub trait Closeable {
236+
pub trait Close {
237237
/// Close the I/O resource
238238
fn close(&mut self);
239239
}
240240

241-
pub trait Stream: Reader + Writer + Closeable { }
241+
pub trait Stream: Reader + Writer + Close { }
242242

243243
pub enum SeekStyle {
244244
/// Seek from the beginning of the stream
@@ -251,7 +251,7 @@ pub enum SeekStyle {
251251

252252
/// # XXX
253253
/// * Are `u64` and `i64` the right choices?
254-
pub trait Seekable {
254+
pub trait Seek {
255255
fn tell(&self) -> u64;
256256
fn seek(&mut self, pos: i64, style: SeekStyle);
257257
}

src/libcore/rt/io/blocking/file.rs renamed to src/libcore/rt/io/native/file.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ impl Writer for FileDesc {
4040
fn flush(&mut self) { fail!() }
4141
}
4242

43-
impl Closeable for FileDesc {
43+
impl Close for FileDesc {
4444
fn close(&mut self) { fail!() }
4545
}
4646

47-
impl Seekable for FileDesc {
47+
impl Seek for FileDesc {
4848
fn tell(&self) -> u64 { fail!() }
4949

5050
fn seek(&mut self, _pos: i64, _style: SeekStyle) { fail!() }
@@ -72,11 +72,11 @@ impl Writer for CFile {
7272
fn flush(&mut self) { fail!() }
7373
}
7474

75-
impl Closeable for CFile {
75+
impl Close for CFile {
7676
fn close(&mut self) { fail!() }
7777
}
7878

79-
impl Seekable for CFile {
79+
impl Seek for CFile {
8080
fn tell(&self) -> u64 { fail!() }
8181
fn seek(&mut self, _pos: i64, _style: SeekStyle) { fail!() }
8282
}

src/libcore/rt/io/net/tcp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ impl Writer for TcpStream {
3333
fn flush(&mut self) { fail!() }
3434
}
3535

36-
impl Closeable for TcpStream {
36+
impl Close for TcpStream {
3737
fn close(&mut self) { fail!() }
3838
}
3939

src/libcore/rt/io/net/udp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ impl Writer for UdpStream {
3333
fn flush(&mut self) { fail!() }
3434
}
3535

36-
impl Closeable for UdpStream {
36+
impl Close for UdpStream {
3737
fn close(&mut self) { fail!() }
3838
}
3939

src/libcore/rt/io/net/unix.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ impl Writer for UnixStream {
3333
fn flush(&mut self) { fail!() }
3434
}
3535

36-
impl Closeable for UnixStream {
36+
impl Close for UnixStream {
3737
fn close(&mut self) { fail!() }
3838
}
3939

src/libcore/rt/io/stdio.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
use prelude::*;
12-
use super::{Reader, Writer, Closeable};
12+
use super::{Reader, Writer, Close};
1313

1414
pub fn stdin() -> StdReader { fail!() }
1515

@@ -39,7 +39,7 @@ impl Reader for StdReader {
3939
fn eof(&mut self) -> bool { fail!() }
4040
}
4141

42-
impl Closeable for StdReader {
42+
impl Close for StdReader {
4343
fn close(&mut self) { fail!() }
4444
}
4545

@@ -55,6 +55,6 @@ impl Writer for StdWriter {
5555
fn flush(&mut self) { fail!() }
5656
}
5757

58-
impl Closeable for StdWriter {
58+
impl Close for StdWriter {
5959
fn close(&mut self) { fail!() }
6060
}

0 commit comments

Comments
 (0)