Skip to content

Commit

Permalink
rvm: Update rust edition to 2021:
Browse files Browse the repository at this point in the history
    Update edition and including changes made by `cargo fix --edition`.
  • Loading branch information
Jaimeloeuf committed Nov 26, 2022
1 parent 4805677 commit 6c2dd68
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion rvm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "rvm"
version = "0.1.0"
authors = ["Jaime <[email protected]>"]
edition = "2018"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
4 changes: 2 additions & 2 deletions rvm/src/compiler/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -578,10 +578,10 @@ impl Compiler {
// Runtime check on debug builds to ensure function parameter count is actually stored
#[cfg(debug_assertions)]
if functions_parameter_count.is_none() {
panic!(format!(
panic!(
"Compiler Debug Error: '{}' function parameter count not stored",
function_name
));
);
}

// Ensure that the number of arguments match the number of parameters defined
Expand Down
2 changes: 1 addition & 1 deletion rvm/src/scanner/scanner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ impl Scanner {
loop {
let token = match scanner.scan_token() {
Ok(token) => token,
Err(err) => panic!(format!("{:?}", err)),
Err(err) => panic!("{:?}", err),
};

if token.line != line as usize {
Expand Down
2 changes: 1 addition & 1 deletion rvm/src/vm/binary_op_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ macro_rules! generic_binary_op {
// Only run this check during debug builds, assuming correctly generated OpCodes will not have this issue
#[cfg(debug_assertions)]
if a.is_none() || b.is_none(){
panic!(format!("VM Debug Error: Stack missing values for {} operation '{}'", $op_name, stringify!($operator)));
panic!("VM Debug Error: Stack missing values for {} operation '{}'", $op_name, stringify!($operator));
}

match (a, b) {
Expand Down

0 comments on commit 6c2dd68

Please sign in to comment.