Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
doonv committed Dec 30, 2023
1 parent 03d2b12 commit 4f1c2b9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/custom_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use bevy::{
prelude::*,
};
use bevy_dev_console::{
builtin_parser::{Environment, RunError, Spanned, StrongRef, Value, Number},
builtin_parser::{Environment, Number, RunError, Spanned, StrongRef, Value},
prelude::*,
register,
};
Expand Down
2 changes: 1 addition & 1 deletion src/builtin_parser/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ fn parse_primary(
let err_map = |error: std::num::ParseIntError| match error.kind() {
IntErrorKind::PosOverflow => ParseError::PositiveIntOverflow(tokens.span()),
IntErrorKind::NegOverflow => ParseError::NegativeIntOverflow(tokens.span()),
_ => unreachable!("lexer makes sure other errors arent possible")
_ => unreachable!("lexer makes sure other errors arent possible"),
};
let number: Number = match tokens.peek_slice() {
"u8" => Number::u8(tokens.slice().parse().map_err(err_map)?),
Expand Down
12 changes: 5 additions & 7 deletions src/builtin_parser/runner/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub enum RunError {
IncompatibleNumberTypes {
left: &'static str,
right: &'static str,
span: Span
span: Span,
},
}

Expand Down Expand Up @@ -105,12 +105,10 @@ impl RunError {
value.kind()
)
.into(),
IncompatibleNumberTypes {
left,
right,
..
} => format!("Incompatible number types; `{left}` and `{right}` are incompatible.")
.into(),
IncompatibleNumberTypes { left, right, .. } => {
format!("Incompatible number types; `{left}` and `{right}` are incompatible.")
.into()
}
}
}
}

0 comments on commit 4f1c2b9

Please sign in to comment.