if bools_bytes != 0 {
for i in range(0, bools_bytes) {
let b = try!(file.read_byte());
- if b < 0 {
- return Err("error: expected more bools but hit EOF".to_owned());
- } else if b == 1 {
+ if b == 1 {
bools_map.insert(bnames[i as uint].to_owned(), true);
}
}
}
// And that's all there is to it
- Ok(~TermInfo {names: term_names, bools: bools_map, numbers: numbers_map, strings: string_map })
+ Ok(box TermInfo {
+ names: term_names,
+ bools: bools_map,
+ numbers: numbers_map,
+ strings: string_map
+ })
}
/// Create a dummy TermInfo struct for msys terminals
strings.insert("bold".to_owned(), Vec::from_slice(bytes!("\x1b[1m")));
strings.insert("setaf".to_owned(), Vec::from_slice(bytes!("\x1b[3%p1%dm")));
strings.insert("setab".to_owned(), Vec::from_slice(bytes!("\x1b[4%p1%dm")));
- ~TermInfo {
+ box TermInfo {
names: vec!("cygwin".to_owned()), // msys is a fork of an older cygwin version
bools: HashMap::new(),
numbers: HashMap::new(),