From 527666104297208c505739ab0611c68790e140ea Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 12 Sep 2024 21:23:17 +0800 Subject: [PATCH] fix clippy --- crates/cli/src/command.rs | 2 +- crates/cli/src/file_backend.rs | 12 ++++++------ crates/cli/src/main.rs | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/cli/src/command.rs b/crates/cli/src/command.rs index ef73cb949..2fc6059e9 100644 --- a/crates/cli/src/command.rs +++ b/crates/cli/src/command.rs @@ -160,7 +160,7 @@ impl SetupArg { let mut monitor = TableMonitor::new( self.k, env_builder.create_flush_strategy(), - Box::new(InMemoryBackend::default()), + Box::::default(), &self.phantom_functions, &env, ); diff --git a/crates/cli/src/file_backend.rs b/crates/cli/src/file_backend.rs index ffc80e2c2..00ff1d64e 100644 --- a/crates/cli/src/file_backend.rs +++ b/crates/cli/src/file_backend.rs @@ -17,12 +17,12 @@ struct SlicePath { external_host_call_table: PathBuf, } -impl Into for &SlicePath { - fn into(self) -> Slice { +impl From<&SlicePath> for Slice { + fn from(val: &SlicePath) -> Self { Slice { - etable: EventTable::read(&self.event_table).unwrap(), - frame_table: FrameTable::read(&self.frame_table).unwrap(), - external_host_call_table: ExternalHostCallTable::read(&self.external_host_call_table) + etable: EventTable::read(&val.event_table).unwrap(), + frame_table: FrameTable::read(&val.frame_table).unwrap(), + external_host_call_table: ExternalHostCallTable::read(&val.external_host_call_table) .unwrap(), } } @@ -113,7 +113,7 @@ impl SliceBackend for FileBackend { if let Some(slice) = self.peeked.as_ref() { f((offset, slice)); - offset = offset + 1; + offset += 1; } self.slices.iter().enumerate().for_each(|(index, slice)| { diff --git a/crates/cli/src/main.rs b/crates/cli/src/main.rs index 62b769ed8..95d2f72fe 100644 --- a/crates/cli/src/main.rs +++ b/crates/cli/src/main.rs @@ -106,7 +106,7 @@ fn main() -> Result<()> { let trace_backend: Box = if arg.file_backend { Box::new(FileBackend::new(cli.name, trace_dir)) } else { - Box::new(InMemoryBackend::default()) + Box::::default() }; let env_builder: Box = match config.host_mode {