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:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user