diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-03-14 22:42:24 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-03-20 19:45:56 -0700 |
| commit | 811257eda5edd7d7d9586a9be4f45a2d4dfa4701 (patch) | |
| tree | 52077c3de72d9a75a9e2cdfcef888931f819790c /src/libterm | |
| parent | 6eae7df43cd21b76fe91eeaf6ef2af9bd2a8fafc (diff) | |
| download | rust-811257eda5edd7d7d9586a9be4f45a2d4dfa4701.tar.gz rust-811257eda5edd7d7d9586a9be4f45a2d4dfa4701.zip | |
std: Rename {push,read}_bytes to {push,read}_exact
These methods can be mistaken for general "read some bytes" utilities when they're actually only meant for reading an exact number of bytes. By renaming them it's much clearer about what they're doing without having to read the documentation. Closes #12892
Diffstat (limited to 'src/libterm')
| -rw-r--r-- | src/libterm/terminfo/parser/compiled.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libterm/terminfo/parser/compiled.rs b/src/libterm/terminfo/parser/compiled.rs index cc97e54709c..13a3cd29e77 100644 --- a/src/libterm/terminfo/parser/compiled.rs +++ b/src/libterm/terminfo/parser/compiled.rs @@ -208,7 +208,7 @@ pub fn parse(file: &mut io::Reader, } // don't read NUL - let bytes = try!(file.read_bytes(names_bytes as uint - 1)); + let bytes = try!(file.read_exact(names_bytes as uint - 1)); let names_str = match str::from_utf8_owned(bytes) { Some(s) => s, None => return Err(~"input not utf-8"), }; @@ -251,7 +251,7 @@ pub fn parse(file: &mut io::Reader, string_offsets.push(try!(file.read_le_u16())); } - let string_table = try!(file.read_bytes(string_table_bytes as uint)); + let string_table = try!(file.read_exact(string_table_bytes as uint)); if string_table.len() != string_table_bytes as uint { return Err(~"error: hit EOF before end of string table"); |
