autoformatting

This commit is contained in:
kyren 2017-08-03 02:03:28 -04:00
parent 1b082b17bc
commit 50436d3463
2 changed files with 11 additions and 3 deletions

View File

@ -35,7 +35,7 @@ fn main() {
}
Err(Error::SyntaxError { incomplete_input: true, .. }) => {
// continue reading input and append it to `line`
line.push_str("\n"); // separate input lines
line.push_str("\n"); // separate input lines
prompt = ">> ";
}
Err(e) => {

View File

@ -103,14 +103,22 @@ impl fmt::Display for Error {
match *self {
Error::SyntaxError { ref message, .. } => write!(fmt, "syntax error: {}", message),
Error::RuntimeError(ref msg) => write!(fmt, "runtime error: {}", msg),
Error::ToLuaConversionError { from, to, ref message } => {
Error::ToLuaConversionError {
from,
to,
ref message,
} => {
write!(fmt, "error converting {} to Lua {}", from, to)?;
match *message {
None => Ok(()),
Some(ref message) => write!(fmt, " ({})", message),
}
}
Error::FromLuaConversionError { from, to, ref message } => {
Error::FromLuaConversionError {
from,
to,
ref message,
} => {
write!(fmt, "error converting Lua {} to {}", from, to)?;
match *message {
None => Ok(()),