From 811257eda5edd7d7d9586a9be4f45a2d4dfa4701 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 14 Mar 2014 22:42:24 -0700 Subject: 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 --- src/libterm/terminfo/parser/compiled.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libterm/terminfo') 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"); -- cgit 1.4.1-3-g733a5