Skip to content

Commit c1a7623

Browse files
committed
rustfmt
1 parent 9f96e01 commit c1a7623

File tree

13 files changed

+27
-17
lines changed

13 files changed

+27
-17
lines changed

primitives/src/ad_unit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ mod postgres {
5858
use super::AdUnit;
5959

6060
use bytes::BytesMut;
61-
use tokio_postgres::types::{accepts, to_sql_checked, FromSql, IsNull, Json, ToSql, Type};
6261
use std::error::Error;
62+
use tokio_postgres::types::{accepts, to_sql_checked, FromSql, IsNull, Json, ToSql, Type};
6363
impl<'a> FromSql<'a> for AdUnit {
6464
fn from_sql(ty: &Type, raw: &'a [u8]) -> Result<Self, Box<dyn Error + Sync + Send>> {
6565
let json = <Json<Self> as FromSql>::from_sql(ty, raw)?;

primitives/src/address.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ pub mod postgres {
177177
use super::Address;
178178
use crate::ToETHChecksum;
179179
use bytes::BytesMut;
180-
use tokio_postgres::types::{FromSql, IsNull, ToSql, Type};
181180
use std::error::Error;
181+
use tokio_postgres::types::{FromSql, IsNull, ToSql, Type};
182182

183183
impl<'a> FromSql<'a> for Address {
184184
fn from_sql(ty: &Type, raw: &'a [u8]) -> Result<Self, Box<dyn Error + Sync + Send>> {

primitives/src/big_num.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,8 @@ where
323323
pub mod postgres {
324324
use super::BigNum;
325325
use bytes::BytesMut;
326-
use tokio_postgres::types::{FromSql, IsNull, ToSql, Type};
327326
use std::error::Error;
327+
use tokio_postgres::types::{FromSql, IsNull, ToSql, Type};
328328

329329
impl<'a> FromSql<'a> for BigNum {
330330
fn from_sql(ty: &Type, raw: &'a [u8]) -> Result<BigNum, Box<dyn Error + Sync + Send>> {

primitives/src/campaign.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,8 @@ mod postgres {
375375

376376
use super::{Active, Campaign, CampaignId, PricingBounds, Validators};
377377
use bytes::BytesMut;
378-
use tokio_postgres::types::{accepts, to_sql_checked, FromSql, IsNull, Json, ToSql, Type};
379378
use std::error::Error;
379+
use tokio_postgres::types::{accepts, to_sql_checked, FromSql, IsNull, Json, ToSql, Type};
380380
use tokio_postgres::Row;
381381

382382
impl From<&Row> for Campaign {

primitives/src/channel.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,8 @@ pub mod postgres {
298298
use super::{Channel, ChannelId, Nonce};
299299
use bytes::BytesMut;
300300
use hex::FromHex;
301-
use tokio_postgres::types::{accepts, to_sql_checked, FromSql, IsNull, ToSql, Type};
302301
use std::error::Error;
302+
use tokio_postgres::types::{accepts, to_sql_checked, FromSql, IsNull, ToSql, Type};
303303
use tokio_postgres::Row;
304304

305305
impl<'a> FromSql<'a> for ChannelId {

primitives/src/event_submission.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ mod postgres {
3232
use super::EventSubmission;
3333

3434
use bytes::BytesMut;
35-
use tokio_postgres::types::{accepts, to_sql_checked, FromSql, IsNull, Json, ToSql, Type};
3635
use std::error::Error;
36+
use tokio_postgres::types::{accepts, to_sql_checked, FromSql, IsNull, Json, ToSql, Type};
3737

3838
impl<'a> FromSql<'a> for EventSubmission {
3939
fn from_sql(ty: &Type, raw: &'a [u8]) -> Result<Self, Box<dyn Error + Sync + Send>> {

primitives/src/sentry.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,10 +608,12 @@ mod postgres {
608608
validator::{messages::Type as MessageType, MessageTypes},
609609
};
610610
use bytes::BytesMut;
611-
use tokio_postgres::types::{accepts, to_sql_checked, IsNull, Json, ToSql, Type};
612611
use serde::Deserialize;
613612
use std::convert::TryFrom;
614-
use tokio_postgres::{Error, Row};
613+
use tokio_postgres::{
614+
types::{accepts, to_sql_checked, IsNull, Json, ToSql, Type},
615+
Error, Row,
616+
};
615617

616618
impl From<&Row> for EventAggregate {
617619
fn from(row: &Row) -> Self {

primitives/src/targeting/eval.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1228,8 +1228,8 @@ fn math_operator(lhs: Number, rhs: Number, ops: MathOperator) -> Result<Number,
12281228
pub mod postgres {
12291229
use super::*;
12301230
use bytes::BytesMut;
1231-
use tokio_postgres::types::{accepts, to_sql_checked, FromSql, IsNull, Json, ToSql, Type};
12321231
use std::error::Error;
1232+
use tokio_postgres::types::{accepts, to_sql_checked, FromSql, IsNull, Json, ToSql, Type};
12331233

12341234
impl ToSql for Rules {
12351235
fn to_sql(

primitives/src/unified_num.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,11 +433,11 @@ mod test {
433433
mod postgres {
434434
use super::UnifiedNum;
435435
use bytes::BytesMut;
436-
use tokio_postgres::types::{accepts, to_sql_checked, FromSql, IsNull, ToSql, Type};
437436
use std::{
438437
convert::{TryFrom, TryInto},
439438
error::Error,
440439
};
440+
use tokio_postgres::types::{accepts, to_sql_checked, FromSql, IsNull, ToSql, Type};
441441

442442
impl<'a> FromSql<'a> for UnifiedNum {
443443
fn from_sql(ty: &Type, raw: &'a [u8]) -> Result<UnifiedNum, Box<dyn Error + Sync + Send>> {

primitives/src/validator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,9 @@ pub mod postgres {
361361
use super::ValidatorId;
362362
use crate::ToETHChecksum;
363363
use bytes::BytesMut;
364-
use tokio_postgres::types::{FromSql, IsNull, ToSql, Type};
365364
use std::convert::TryFrom;
366365
use std::error::Error;
366+
use tokio_postgres::types::{FromSql, IsNull, ToSql, Type};
367367

368368
impl<'a> FromSql<'a> for ValidatorId {
369369
fn from_sql(ty: &Type, raw: &'a [u8]) -> Result<Self, Box<dyn Error + Sync + Send>> {

sentry/src/access.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ mod test {
169169

170170
use chrono::TimeZone;
171171
use primitives::{
172-
config::{DEVELOPMENT_CONFIG},
172+
config::DEVELOPMENT_CONFIG,
173173
event_submission::{RateLimit, Rule},
174174
sentry::Event,
175175
util::tests::prep_db::{ADDRESSES, DUMMY_CAMPAIGN, IDS},

sentry/src/db.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,13 +334,19 @@ pub mod tests_postgres {
334334
// set the database in the configuration of the inside Pool (used for tests)
335335
config.dbname(&database.name);
336336

337-
let manager =
338-
deadpool_postgres::Manager::from_config(config, NoTls, self.manager_config.clone());
339-
337+
let manager = deadpool_postgres::Manager::from_config(
338+
config,
339+
NoTls,
340+
self.manager_config.clone(),
341+
);
342+
340343
deadpool_postgres::Pool::new(manager, 15)
341344
};
342345

343-
let result = database.pool.get().await?
346+
let result = database
347+
.pool
348+
.get()
349+
.await?
344350
.simple_query(queries)
345351
.await
346352
.map_err(PoolError::Backend)

test_harness/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,9 @@ pub mod run {
730730
let postgres = postgres_connection(42, postgres_config).await;
731731
let mut redis = redis_connection(app_config.redis_url).await?;
732732

733-
Manager::flush_db(&mut redis).await.expect("Should flush redis database");
733+
Manager::flush_db(&mut redis)
734+
.await
735+
.expect("Should flush redis database");
734736

735737
let campaign_remaining = CampaignRemaining::new(redis.clone());
736738

0 commit comments

Comments
 (0)