Remove io::read_error
The general idea is to remove conditions completely from I/O, so in the meantime remove the read_error condition to mean the same thing as the io_error condition.
This commit is contained in:
parent
e117aa0e2a
commit
6b70ddfba1
9 changed files with 42 additions and 52 deletions
|
|
@ -93,7 +93,7 @@ pub fn expand_include_str(cx: @ExtCtxt, sp: Span, tts: &[ast::token_tree])
|
|||
let file = get_single_str_from_tts(cx, sp, tts, "include_str!");
|
||||
let file = res_rel_file(cx, sp, &Path::new(file));
|
||||
let mut error = None;
|
||||
let bytes = do io::read_error::cond.trap(|e| error = Some(e)).inside {
|
||||
let bytes = do io::io_error::cond.trap(|e| error = Some(e)).inside {
|
||||
file.open_reader(io::Open).read_to_end()
|
||||
};
|
||||
match error {
|
||||
|
|
@ -120,10 +120,8 @@ pub fn expand_include_bin(cx: @ExtCtxt, sp: Span, tts: &[ast::token_tree])
|
|||
let file = res_rel_file(cx, sp, &Path::new(file));
|
||||
|
||||
let mut error = None;
|
||||
let bytes = do io::read_error::cond.trap(|e| error = Some(e)).inside {
|
||||
do io::io_error::cond.trap(|e| error = Some(e)).inside {
|
||||
file.open_reader(io::Open).read_to_end()
|
||||
}
|
||||
let bytes = do io::io_error::cond.trap(|e| error = Some(e)).inside {
|
||||
file.open_reader(io::Open).read_to_end()
|
||||
};
|
||||
match error {
|
||||
Some(e) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue