1) Change namespaces to iter_namespaces
2) throw can throw any value
This commit is contained in:
@@ -29,18 +29,11 @@ fn print_error(input: &str, err: EvalAltResult) {
|
||||
// Specific position
|
||||
println!("{}{}", line_no, lines[pos.line().unwrap() - 1]);
|
||||
|
||||
let err_text = match err {
|
||||
EvalAltResult::ErrorRuntime(err, _) if !err.is_empty() => {
|
||||
format!("Runtime error: {}", err)
|
||||
}
|
||||
err => err.to_string(),
|
||||
};
|
||||
|
||||
println!(
|
||||
"{0:>1$} {2}",
|
||||
"^",
|
||||
line_no.len() + pos.position().unwrap(),
|
||||
err_text.replace(&pos_text, "")
|
||||
err.to_string().replace(&pos_text, "")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -32,14 +32,7 @@ fn eprint_error(input: &str, err: EvalAltResult) {
|
||||
eprintln!("{}", err);
|
||||
} else {
|
||||
// Specific position
|
||||
let err_text = match err {
|
||||
EvalAltResult::ErrorRuntime(err, _) if !err.is_empty() => {
|
||||
format!("Runtime error: {}", err)
|
||||
}
|
||||
err => err.to_string(),
|
||||
};
|
||||
|
||||
eprint_line(&lines, pos, &err_text)
|
||||
eprint_line(&lines, pos, &err.to_string())
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user