mirror of
https://github.com/voltrevo/ValueScript.git
synced 2026-01-09 13:38:03 -05:00
Clippy fixes
This commit is contained in:
@@ -2,6 +2,6 @@ use crate::asm::{Number, Value};
|
||||
|
||||
pub const CONSTANTS: [(&str, Value); 3] = [
|
||||
("undefined", Value::Undefined),
|
||||
("NaN", Value::Number(Number(std::f64::NAN))),
|
||||
("Infinity", Value::Number(Number(std::f64::INFINITY))),
|
||||
("NaN", Value::Number(Number(f64::NAN))),
|
||||
("Infinity", Value::Number(Number(f64::INFINITY))),
|
||||
];
|
||||
|
||||
@@ -60,13 +60,6 @@ impl Functionish {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct QueuedFunction {
|
||||
pub definition_pointer: Pointer,
|
||||
pub fn_name: Option<String>,
|
||||
pub functionish: Functionish,
|
||||
}
|
||||
|
||||
pub struct LoopLabels {
|
||||
pub continue_: Option<Label>,
|
||||
pub break_: Label,
|
||||
|
||||
@@ -88,7 +88,7 @@ fn simplify_jumps_fn(fn_: &mut Function) {
|
||||
}
|
||||
}
|
||||
|
||||
fn next_instruction_index(body: &Vec<FnLine>, mut i: usize) -> Option<usize> {
|
||||
fn next_instruction_index(body: &[FnLine], mut i: usize) -> Option<usize> {
|
||||
i += 1;
|
||||
|
||||
while i < body.len() {
|
||||
|
||||
@@ -387,9 +387,7 @@ pub fn op_triple_eq_impl(left: &Val, right: &Val) -> Result<bool, Val> {
|
||||
|
||||
true
|
||||
}
|
||||
#[allow(clippy::vtable_address_comparisons)] // TODO: Is this ok?
|
||||
(Val::Static(left), Val::Static(right)) => std::ptr::eq(&**left, &**right),
|
||||
#[allow(clippy::vtable_address_comparisons)] // TODO: Is this ok?
|
||||
(Val::Dynamic(left), Val::Dynamic(right)) => std::ptr::eq(&**left, &**right),
|
||||
(Val::Static(..) | Val::Dynamic(..) | Val::CopyCounter(..), _)
|
||||
| (_, Val::Static(..) | Val::Dynamic(..) | Val::CopyCounter(..)) => {
|
||||
|
||||
@@ -2,7 +2,7 @@ use valuescript_compiler::{assemble, parse_module};
|
||||
|
||||
use crate::exit_command_failed::exit_command_failed;
|
||||
|
||||
pub fn assemble_command(args: &Vec<String>) {
|
||||
pub fn assemble_command(args: &[String]) {
|
||||
if args.len() != 3 {
|
||||
exit_command_failed(args, None, "vstc assemble --help");
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ use super::handle_diagnostics_cli::handle_diagnostics_cli;
|
||||
use valuescript_compiler::asm::Structured;
|
||||
use valuescript_compiler::compile;
|
||||
|
||||
pub fn compile_command(args: &Vec<String>) {
|
||||
pub fn compile_command(args: &[String]) {
|
||||
if args.len() != 3 {
|
||||
exit_command_failed(args, None, "vstc compile --help");
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ use valuescript_vm::{vs_value::Val, DecoderMaker};
|
||||
use crate::exit_command_failed::exit_command_failed;
|
||||
use crate::to_bytecode::{format_from_path, to_bytecode, RunFormat};
|
||||
|
||||
pub fn run_command(args: &Vec<String>) {
|
||||
pub fn run_command(args: &[String]) {
|
||||
if args.len() < 3 {
|
||||
exit_command_failed(args, None, "vstc run --help");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user