From 71da39f8b5ec03df5b5a88de3e8f2543a477965e Mon Sep 17 00:00:00 2001 From: Jeff Date: Wed, 18 Dec 2024 08:56:58 -0500 Subject: [PATCH] Clean up warnings --- dust-cli/src/main.rs | 6 +----- dust-lang/src/chunk/mod.rs | 1 + dust-lang/src/vm/record.rs | 16 +--------------- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/dust-cli/src/main.rs b/dust-cli/src/main.rs index 935e4ed..1ef59b3 100644 --- a/dust-cli/src/main.rs +++ b/dust-cli/src/main.rs @@ -86,10 +86,6 @@ struct Cli { } #[derive(Args)] -#[clap( - styles = STYLES, -)] -#[group()] struct Input { /// Source code to run instead of a file #[arg(short, long, value_hint = ValueHint::Other, value_name = "INPUT")] @@ -234,7 +230,7 @@ fn main() { } } - let chunk = compiler.finish(file_name); + let chunk = compiler.finish(name.or(file_name)); let mut stdout = stdout().lock(); chunk diff --git a/dust-lang/src/chunk/mod.rs b/dust-lang/src/chunk/mod.rs index ec67719..d8c1db6 100644 --- a/dust-lang/src/chunk/mod.rs +++ b/dust-lang/src/chunk/mod.rs @@ -49,6 +49,7 @@ pub struct Chunk { } impl Chunk { + #[allow(clippy::too_many_arguments)] pub(crate) fn new( name: Option, r#type: FunctionType, diff --git a/dust-lang/src/vm/record.rs b/dust-lang/src/vm/record.rs index ce8f08c..9778576 100644 --- a/dust-lang/src/vm/record.rs +++ b/dust-lang/src/vm/record.rs @@ -20,11 +20,11 @@ pub struct Record { constants: SmallVec<[Value; 16]>, locals: SmallVec<[Local; 8]>, - stack_size: usize, index: u8, } impl Record { + #[allow(clippy::too_many_arguments)] pub fn new( actions: SmallVec<[RunAction; 32]>, last_assigned_register: Option, @@ -46,7 +46,6 @@ impl Record { positions, constants, locals, - stack_size, index, } } @@ -88,19 +87,6 @@ impl Record { } } - pub(crate) fn follow_pointer_allow_empty(&self, pointer: Pointer) -> Option<&Value> { - log::trace!("Follow pointer {pointer}"); - - match pointer { - Pointer::Stack(register_index) => self.open_register_allow_empty(register_index), - Pointer::Constant(constant_index) => { - let constant = self.get_constant(constant_index); - - Some(constant) - } - } - } - pub fn get_register(&self, register_index: u8) -> &Register { log::trace!("Get register R{register_index}");