1
0

Clean up warnings

This commit is contained in:
Jeff 2024-12-18 08:56:58 -05:00
parent ed05a981e7
commit 71da39f8b5
3 changed files with 3 additions and 20 deletions

View File

@ -86,10 +86,6 @@ struct Cli {
} }
#[derive(Args)] #[derive(Args)]
#[clap(
styles = STYLES,
)]
#[group()]
struct Input { struct Input {
/// Source code to run instead of a file /// Source code to run instead of a file
#[arg(short, long, value_hint = ValueHint::Other, value_name = "INPUT")] #[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(); let mut stdout = stdout().lock();
chunk chunk

View File

@ -49,6 +49,7 @@ pub struct Chunk {
} }
impl Chunk { impl Chunk {
#[allow(clippy::too_many_arguments)]
pub(crate) fn new( pub(crate) fn new(
name: Option<DustString>, name: Option<DustString>,
r#type: FunctionType, r#type: FunctionType,

View File

@ -20,11 +20,11 @@ pub struct Record {
constants: SmallVec<[Value; 16]>, constants: SmallVec<[Value; 16]>,
locals: SmallVec<[Local; 8]>, locals: SmallVec<[Local; 8]>,
stack_size: usize,
index: u8, index: u8,
} }
impl Record { impl Record {
#[allow(clippy::too_many_arguments)]
pub fn new( pub fn new(
actions: SmallVec<[RunAction; 32]>, actions: SmallVec<[RunAction; 32]>,
last_assigned_register: Option<u8>, last_assigned_register: Option<u8>,
@ -46,7 +46,6 @@ impl Record {
positions, positions,
constants, constants,
locals, locals,
stack_size,
index, 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 { pub fn get_register(&self, register_index: u8) -> &Register {
log::trace!("Get register R{register_index}"); log::trace!("Get register R{register_index}");