diff options
| author | Patrick Walton <[email protected]> | 2011-05-02 17:47:24 -0700 |
|---|---|---|
| committer | Patrick Walton <[email protected]> | 2011-05-02 17:50:46 -0700 |
| commit | 147a2d655f86c66b6edfebc20b927a8de8668722 (patch) | |
| tree | 5af8cebd67a6fe620fbe4fb84a9e73cabf764251 /src/lib/io.rs | |
| parent | Use check instead of assert in export-unexported-dep (diff) | |
| download | rust-147a2d655f86c66b6edfebc20b927a8de8668722.tar.xz rust-147a2d655f86c66b6edfebc20b927a8de8668722.zip | |
Un-revert "Use different syntax for checks that matter to typestate", fixing the problem.
This reverts commit d08b443fffb1181d8d45ae5d061412f202dd4118.
Diffstat (limited to 'src/lib/io.rs')
| -rw-r--r-- | src/lib/io.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/io.rs b/src/lib/io.rs index 4c1bf2df..7d59da30 100644 --- a/src/lib/io.rs +++ b/src/lib/io.rs @@ -72,7 +72,7 @@ state obj FILE_buf_reader(os.libc.FILE f, bool must_close) { ret os.libc.feof(f) != 0; } fn seek(int offset, seek_style whence) { - check (os.libc.fseek(f, offset, convert_whence(whence)) == 0); + assert (os.libc.fseek(f, offset, convert_whence(whence)) == 0); } fn tell() -> uint { ret os.libc.ftell(f) as uint; @@ -101,14 +101,14 @@ state obj new_reader(buf_reader rdr) { if (c0 == -1) {ret -1 as char;} // FIXME will this stay valid? auto b0 = c0 as u8; auto w = _str.utf8_char_width(b0); - check(w > 0u); + assert (w > 0u); if (w == 1u) {ret b0 as char;} auto val = 0u; while (w > 1u) { w -= 1u; auto next = rdr.read_byte(); - check(next > -1); - check(next & 0xc0 == 0x80); + assert (next > -1); + assert (next & 0xc0 == 0x80); val <<= 6u; val += (next & 0x3f) as uint; } @@ -279,7 +279,7 @@ state obj FILE_writer(os.libc.FILE f, bool must_close) { } fn seek(int offset, seek_style whence) { - check(os.libc.fseek(f, offset, convert_whence(whence)) == 0); + assert (os.libc.fseek(f, offset, convert_whence(whence)) == 0); } fn tell() -> uint { |