Skip to content

Commit 505ad2a

Browse files
committed
---
yaml --- r: 56294 b: refs/heads/auto c: 69f6ac5 h: refs/heads/master v: v3
1 parent eae3bfe commit 505ad2a

File tree

27 files changed

+219
-1905
lines changed

27 files changed

+219
-1905
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: 6510fd92544467a03df93b5124644976aa79f964
17+
refs/heads/auto: 69f6ac5d31fbd2a4bcf104a818e79d6e4e34c8f7
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/doc/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1670,7 +1670,7 @@ do spawn {
16701670
~~~~
16711671

16721672
If you want to see the output of `debug!` statements, you will need to turn on `debug!` logging.
1673-
To enable `debug!` logging, set the RUST_LOG environment variable to `debug` (e.g., with bash, `export RUST_LOG=debug`)
1673+
To enable `debug!` logging, set the RUST_LOG environment variable to the name of your crate, which, for a file named `foo.rs`, will be `foo` (e.g., with bash, `export RUST_LOG=foo`).
16741674

16751675
## For loops
16761676

branches/auto/src/libcore/rt/io/comm_adapters.rs

Lines changed: 0 additions & 59 deletions
This file was deleted.

branches/auto/src/libcore/rt/io/file.rs

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

1111
use prelude::*;
12-
use super::misc::PathLike;
13-
use super::{Reader, Writer, Seek, Close};
14-
use super::{IoError, SeekStyle};
15-
16-
/// Open a file with the default FileMode and FileAccess
17-
/// # XXX are there sane defaults here?
18-
pub fn open_file<P: PathLike>(_path: &P) -> FileStream { fail!() }
19-
20-
/// # XXX
21-
/// * Ugh, this is ridiculous. What is the best way to represent these options?
22-
enum FileMode {
23-
/// Opens an existing file. IoError if file does not exist.
24-
Open,
25-
/// Creates a file. IoError if file exists.
26-
Create,
27-
/// Opens an existing file or creates a new one.
28-
OpenOrCreate,
29-
/// Opens an existing file or creates a new one, positioned at EOF.
30-
Append,
31-
/// Opens an existing file, truncating it to 0 bytes.
32-
Truncate,
33-
/// Opens an existing file or creates a new one, truncating it to 0 bytes.
34-
CreateOrTruncate,
35-
}
36-
37-
enum FileAccess {
38-
Read,
39-
Write,
40-
ReadWrite
41-
}
12+
use super::Stream;
4213

4314
pub struct FileStream;
4415

45-
impl FileStream {
46-
pub fn open<P: PathLike>(_path: &P,
47-
_mode: FileMode,
48-
_access: FileAccess
49-
) -> Result<FileStream, IoError> {
16+
pub impl FileStream {
17+
fn new(_path: Path) -> FileStream {
5018
fail!()
5119
}
5220
}
5321

54-
impl Reader for FileStream {
55-
fn read(&mut self, _buf: &mut [u8]) -> Option<uint> {
22+
impl Stream for FileStream {
23+
fn read(&mut self, _buf: &mut [u8]) -> uint {
5624
fail!()
5725
}
5826

5927
fn eof(&mut self) -> bool {
6028
fail!()
6129
}
62-
}
63-
64-
impl Writer for FileStream {
65-
fn write(&mut self, _v: &[u8]) { fail!() }
6630

67-
fn flush(&mut self) { fail!() }
68-
}
69-
70-
impl Seek for FileStream {
71-
fn tell(&self) -> u64 { fail!() }
72-
73-
fn seek(&mut self, _pos: i64, _style: SeekStyle) { fail!() }
74-
}
75-
76-
impl Close for FileStream {
77-
fn close(&mut self) { fail!() }
31+
fn write(&mut self, _v: &const [u8]) {
32+
fail!()
33+
}
7834
}
7935

8036
#[test]
8137
#[ignore]
8238
fn super_simple_smoke_test_lets_go_read_some_files_and_have_a_good_time() {
8339
let message = "it's alright. have a good time";
84-
let filename = &Path("test.txt");
85-
let mut outstream = FileStream::open(filename, Create, Read).unwrap();
40+
let filename = Path("test.txt");
41+
let mut outstream = FileStream::new(filename);
8642
outstream.write(message.to_bytes());
8743
}

branches/auto/src/libcore/rt/io/flate.rs

Lines changed: 0 additions & 121 deletions
This file was deleted.

0 commit comments

Comments
 (0)