Skip to content

Commit 6e0f05b

Browse files
committed
auto merge of #4790 : pcwalton/rust/at-readers, r=pcwalton
2 parents 2e77526 + 7d5322c commit 6e0f05b

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/libcore/io.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -490,25 +490,25 @@ pub fn FILERes(f: *libc::FILE) -> FILERes {
490490
}
491491
}
492492

493-
pub fn FILE_reader(f: *libc::FILE, cleanup: bool) -> Reader {
493+
pub fn FILE_reader(f: *libc::FILE, cleanup: bool) -> @Reader {
494494
if cleanup {
495-
Wrapper { base: f, cleanup: FILERes(f) } as Reader
495+
@Wrapper { base: f, cleanup: FILERes(f) } as @Reader
496496
} else {
497-
f as Reader
497+
@f as @Reader
498498
}
499499
}
500500

501501
// FIXME (#2004): this should either be an trait-less impl, a set of
502502
// top-level functions that take a reader, or a set of default methods on
503503
// reader (which can then be called reader)
504504

505-
pub fn stdin() -> Reader {
505+
pub fn stdin() -> @Reader {
506506
unsafe {
507-
rustrt::rust_get_stdin() as Reader
507+
rustrt::rust_get_stdin() as @Reader
508508
}
509509
}
510510

511-
pub fn file_reader(path: &Path) -> Result<Reader, ~str> {
511+
pub fn file_reader(path: &Path) -> Result<@Reader, ~str> {
512512
unsafe {
513513
let f = os::as_c_charp(path.to_str(), |pathbuf| {
514514
os::as_c_charp("r", |modebuf|
@@ -555,11 +555,11 @@ impl BytesReader: Reader {
555555
fn tell(&self) -> uint { self.pos }
556556
}
557557
558-
pub pure fn with_bytes_reader<t>(bytes: &[u8], f: fn(Reader) -> t) -> t {
559-
f(BytesReader { bytes: bytes, pos: 0u } as Reader)
558+
pub pure fn with_bytes_reader<t>(bytes: &[u8], f: fn(@Reader) -> t) -> t {
559+
f(@BytesReader { bytes: bytes, pos: 0u } as @Reader)
560560
}
561561
562-
pub pure fn with_str_reader<T>(s: &str, f: fn(Reader) -> T) -> T {
562+
pub pure fn with_str_reader<T>(s: &str, f: fn(@Reader) -> T) -> T {
563563
str::byte_slice(s, |bytes| with_bytes_reader(bytes, f))
564564
}
565565

0 commit comments

Comments
 (0)