misc: more clippy fixes, **switched to stable**
The switch was due to rust-analyzer bug on latest nightly, please use stable until [this bug](https://github.com/rust-lang/rust-analyzer/issues/20051) is fixed
This commit is contained in:
@@ -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];
|
||||
}
|
||||
|
||||
@@ -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<Message>,
|
||||
|
||||
@@ -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<Command>,
|
||||
state_tx: &Sender<State>,
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user