diff options
| author | Jeff Olson <olson.jeffery@gmail.com> | 2013-08-22 15:03:28 -0700 |
|---|---|---|
| committer | Jeff Olson <olson.jeffery@gmail.com> | 2013-08-22 16:31:58 -0700 |
| commit | 6311856bf42828e3c502a28b414586badb1192c8 (patch) | |
| tree | f7893af766120411748e55c963a699c1b0d9abd6 /src/libstd/rt/io | |
| parent | 94b84a851c1ac088c884c8dde00199fdf91d9f4d (diff) | |
| download | rust-6311856bf42828e3c502a28b414586badb1192c8.tar.gz rust-6311856bf42828e3c502a28b414586badb1192c8.zip | |
std: slight refactor on UvFilestream seek behavior, pre-seek-refactor
Diffstat (limited to 'src/libstd/rt/io')
| -rw-r--r-- | src/libstd/rt/io/file.rs | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/libstd/rt/io/file.rs b/src/libstd/rt/io/file.rs index c4ec19b6d27..816f7e08eab 100644 --- a/src/libstd/rt/io/file.rs +++ b/src/libstd/rt/io/file.rs @@ -170,15 +170,9 @@ impl Seek for FileStream { } fn seek(&mut self, pos: i64, style: SeekStyle) { - use libc::{SEEK_SET, SEEK_CUR, SEEK_END}; - let whence = match style { - SeekSet => SEEK_SET, - SeekCur => SEEK_CUR, - SeekEnd => SEEK_END - } as i64; - match self.fd.seek(pos, whence) { + match self.fd.seek(pos, style) { Ok(_) => { - // successful seek resets EOF indocator + // successful seek resets EOF indicator self.last_nread = -1; () }, |
