Skip to content

Commit 9521770

Browse files
committed
fix: apply proper formatting
1 parent 7f9b089 commit 9521770

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

sentry/src/event_aggregator.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ use chrono::Utc;
1010
use primitives::adapter::Adapter;
1111
use primitives::sentry::{Event, EventAggregate};
1212
use primitives::{Channel, ChannelId};
13+
use slog::{error, Logger};
1314
use std::collections::HashMap;
1415
use std::sync::Arc;
1516
use std::time::Duration;
1617
use tokio::time::delay_for;
17-
use slog::{error, Logger};
18-
1918

2019
#[derive(Default, Clone)]
2120
pub struct EventAggregator {
@@ -117,7 +116,13 @@ impl EventAggregator {
117116
drop(recorder);
118117

119118
if aggr_throttle == 0 {
120-
store(&app.pool, &channel.id, &app.logger.clone(), self.aggregate.clone()).await;
119+
store(
120+
&app.pool,
121+
&channel.id,
122+
&app.logger.clone(),
123+
self.aggregate.clone(),
124+
)
125+
.await;
121126
}
122127

123128
Ok(())

sentry/src/middleware/auth.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,13 @@ fn get_request_ip(req: &Request<Body>) -> Option<String> {
7575
.get("true-client-ip")
7676
.or_else(|| req.headers().get("x-forwarded-for"))
7777
.and_then(|hv| hv.to_str().map(ToString::to_string).ok())
78-
.map(|token| token.split(',').nth(0).map(ToString::to_string).expect("should have ip"))
78+
.map(|token| {
79+
token
80+
.split(',')
81+
.nth(0)
82+
.map(ToString::to_string)
83+
.expect("should have ip")
84+
})
7985
}
8086

8187
#[cfg(test)]

sentry/src/routes/channel.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ pub async fn insert_events<A: Adapter + 'static>(
126126
let events = request_body
127127
.get("events")
128128
.ok_or_else(|| ResponseError::BadRequest("invalid request".to_string()))?;
129-
129+
130130
app.event_aggregator
131131
.record(app, &channel, &session, &events.as_slice())
132132
.await?;

0 commit comments

Comments
 (0)