Skip to content

Commit

Permalink
nit: fmt + clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
ts0yu authored Aug 28, 2024
1 parent 2979ae0 commit 566182a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 25 deletions.
10 changes: 1 addition & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,7 @@ edition = "2021"
repository = "https://github.com/arena-rs/arena"
description = "Framework for holistic economic modelling and simulation of Uniswap v4 strategies, hooks and pools."
license-file = "./LICENSE"
exclude = ["contracts", "cli"]

[lib]
name = "libarena"
path = "src/lib.rs"

[[bin]]
name = "arena"
path = "src/bin/cli.rs"
exclude = ["contracts"]

[dependencies]
rug = "1.25.0"
Expand Down
9 changes: 0 additions & 9 deletions src/Cargo.toml

This file was deleted.

1 change: 0 additions & 1 deletion src/bin/cli.rs

This file was deleted.

9 changes: 4 additions & 5 deletions src/engine/inspector.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::fs::OpenOptions;
use std::io::Seek;
use std::{fs::OpenOptions, io::Seek};

use serde::{Deserialize, Serialize};

/// Trait allowing custom behavior to be defined for logging and inspecting values.
Expand Down Expand Up @@ -75,10 +75,9 @@ impl Logger {
fn append_to_file(&self, record: &LogMessage) -> Result<(), Box<dyn std::error::Error>> {
let mut file = OpenOptions::new()
.append(true)
.write(true)
.create(true)
.open(&self.file_path)?;

match self.format {
LogFormat::Csv => {
let mut writer = csv::Writer::from_writer(file);
Expand All @@ -98,7 +97,7 @@ impl Logger {
}
}
Ok(())
}
}
}

impl Inspector<LogMessage> for Logger {
Expand Down
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,10 @@ mod tests {
_signal: Signal,
inspector: &mut Box<dyn Inspector<LogMessage>>,
) {
inspector.log(LogMessage::new(String::from("test_key"), String::from("test_value")));
inspector.log(LogMessage::new(
String::from("test_key"),
String::from("test_value"),
));
}
}

Expand Down

0 comments on commit 566182a

Please sign in to comment.