diff --git a/assembler/src/assembler/parser.rs b/assembler/src/assembler/parser.rs index 9f8734d..73c23fa 100644 --- a/assembler/src/assembler/parser.rs +++ b/assembler/src/assembler/parser.rs @@ -108,10 +108,10 @@ impl Parser { let dest = expect_type!(self.next()?, Register)?; let mut offset = Token::Immediate(0); - if let Ok(next) = self.peek_next() - && expect_type!(next, Immediate).is_ok() - { - offset = self.next()?; + if let Ok(next) = self.peek_next() { + if expect_type!(next, Immediate).is_ok() { + offset = self.next()?; + } } args = vec![base, dest, offset]; @@ -120,10 +120,10 @@ impl Parser { let base = expect_type!(self.next()?, Register)?; let dest = expect_type!(self.next()?, Register, Symbol)?; let mut offset = Token::Immediate(0); - if let Ok(next) = self.peek_next() - && expect_type!(next, Immediate).is_ok() - { - offset = self.next()?; + if let Ok(next) = self.peek_next() { + if expect_type!(next, Immediate).is_ok() { + offset = self.next()?; + } } args = vec![base, dest, offset]; } diff --git a/emulator/src/emulator/misc/rpc.rs b/emulator/src/emulator/misc/rpc.rs index 086750d..3ef47e3 100644 --- a/emulator/src/emulator/misc/rpc.rs +++ b/emulator/src/emulator/misc/rpc.rs @@ -7,7 +7,7 @@ //! //! # Configuration //! -//! This may be disabled like so in your `.dsarc.toml` file: +//! This may be disabled like so in your `.dsa.emulator.toml` file: //! //! ```toml //! [misc] @@ -16,6 +16,9 @@ //! //! Alternatively, you can hide this in your Discord settings. +#[cfg(feature = "discord-rpc")] +use std::{path::PathBuf, sync::Arc, time::Duration}; + use std::sync::mpsc::{Receiver, Sender}; #[cfg(feature = "discord-rpc")] @@ -200,6 +203,7 @@ pub enum Activity {} /// Gets the discord [`RpcClient`] or returns None if this has been disabled in the config /// options. #[cfg(feature = "config")] +#[allow(clippy::needless_pass_by_value, unused_variables)] pub fn get_rpc_client_or_none( config: &Config, rpc_sender: Sender, diff --git a/emulator/src/emulator/system/emulator.rs b/emulator/src/emulator/system/emulator.rs index 342fcc4..24daa34 100644 --- a/emulator/src/emulator/system/emulator.rs +++ b/emulator/src/emulator/system/emulator.rs @@ -5,7 +5,9 @@ use std::{ time::Duration, }; -use crate::emulator::misc::rpc::RpcClient; +#[allow(unused_imports)] +use crate::emulator::misc::rpc::{Activity, RpcClient}; + use crate::emulator::system::{ model::{Command, PersistentState, Running, State}, processor::Processor, @@ -14,6 +16,7 @@ use crate::emulator::system::{ use common::prelude::*; #[expect(clippy::too_many_lines)] +#[allow(unused_variables)] pub fn run_emulator( cmd_rx: &Receiver, state_tx: &Sender, diff --git a/emulator/src/emulator/ui/editor.rs b/emulator/src/emulator/ui/editor.rs index 8c1e1de..98cc1c2 100644 --- a/emulator/src/emulator/ui/editor.rs +++ b/emulator/src/emulator/ui/editor.rs @@ -344,8 +344,8 @@ impl Editor { } // builds the current file - if ui.button("Build").clicked() && !self.unsaved - && let Some(path) = &self.path { + if ui.button("Build").clicked() && !self.unsaved { + if let Some(path) = &self.path { let mut assembler = CompilerEngine::new(); if let Err(error) = assembler.assemble(path) { self.error = Some(format!("Failed to assemble: {error:?}")); @@ -371,6 +371,7 @@ impl Editor { .flat_map(|i| i.encode().to_be_bytes().to_vec()) .collect(); } + } // Loads the generated binary into the assembler at the provided offset if ui.button("Load").clicked() {