Skip to content

Commit 0bb6f67

Browse files
committed
fmt, allow panic in tests
1 parent 249a49c commit 0bb6f67

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

apps/pyth-lazer-agent/clippy.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
allow-unwrap-in-tests = true
22
allow-expect-in-tests = true
33
allow-indexing-slicing-in-tests = true
4+
allow-panic-in-tests = true

apps/pyth-lazer-agent/src/main.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ struct Cli {
2222

2323
#[tokio::main]
2424
async fn main() -> anyhow::Result<()> {
25-
#[allow(clippy::expect_used, reason = "application can fail on invalid RUST_LOG")]
25+
#[allow(
26+
clippy::expect_used,
27+
reason = "application can fail on invalid RUST_LOG"
28+
)]
2629
tracing_subscriber::fmt()
2730
.with_env_filter(
2831
EnvFilter::builder()

apps/pyth-lazer-agent/src/publisher_handle.rs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,15 @@ async fn try_handle_publisher(
8888
) {
8989
Ok((data, _)) => {
9090
let source_timestamp = MessageField::some(Timestamp {
91-
#[allow(clippy::cast_possible_wrap, reason = "Unix seconds won't wrap any time soon")]
91+
#[allow(
92+
clippy::cast_possible_wrap,
93+
reason = "Unix seconds won't wrap any time soon"
94+
)]
9295
seconds: (data.source_timestamp_us.0 / 1_000_000) as i64,
93-
#[allow(clippy::cast_possible_truncation, reason = "this value will always be less than one billion")]
96+
#[allow(
97+
clippy::cast_possible_truncation,
98+
reason = "this value will always be less than one billion"
99+
)]
94100
nanos: (data.source_timestamp_us.0 % 1_000_000 * 1000) as i32,
95101
special_fields: Default::default(),
96102
});
@@ -133,9 +139,15 @@ async fn try_handle_publisher(
133139
) {
134140
Ok((data, _)) => {
135141
let source_timestamp = MessageField::some(Timestamp {
136-
#[allow(clippy::cast_possible_wrap, reason = "Unix seconds won't wrap any time soon")]
142+
#[allow(
143+
clippy::cast_possible_wrap,
144+
reason = "Unix seconds won't wrap any time soon"
145+
)]
137146
seconds: (data.source_timestamp_us.0 / 1_000_000) as i64,
138-
#[allow(clippy::cast_possible_truncation, reason = "this value will always be less than one billion")]
147+
#[allow(
148+
clippy::cast_possible_truncation,
149+
reason = "this value will always be less than one billion"
150+
)]
139151
nanos: (data.source_timestamp_us.0 % 1_000_000 * 1000) as i32,
140152
special_fields: Default::default(),
141153
});

0 commit comments

Comments
 (0)