Skip to content

Commit f10a46e

Browse files
committed
Code formatting.
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
1 parent 8e3a38c commit f10a46e

7 files changed

Lines changed: 18 additions & 19 deletions

File tree

arancini-lib/src/processor.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use crate::sender::UpdateSender;
1111
use crate::state::AsyncState;
1212
use crate::state::{peer_up_withdraws_handler, process_updates, synthesize_withdraw_update};
1313
use crate::state_store::store::StateStore;
14-
use crate::update::{decode_updates, UpdateMetadata};
14+
use crate::update::{UpdateMetadata, decode_updates};
1515

1616
pub fn decode_bmp_message(bytes: &mut Bytes) -> Result<BmpMessage> {
1717
let message = match parse_bmp_msg(bytes) {
@@ -120,15 +120,15 @@ pub async fn peer_down_notification<T: StateStore, S: UpdateSender>(
120120
#[cfg(test)]
121121
mod tests {
122122
use super::*;
123-
use crate::state::{new_state, State};
123+
use crate::state::{State, new_state};
124124
use crate::state_store::memory::MemoryStore;
125-
use crate::update::{map_to_ipv6, Update, UpdateAttributes};
125+
use crate::update::{Update, UpdateAttributes, map_to_ipv6};
126126
use chrono::Utc;
127127
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
128-
use std::sync::atomic::{AtomicUsize, Ordering};
129128
use std::sync::Arc;
129+
use std::sync::atomic::{AtomicUsize, Ordering};
130130
use tokio::sync::{Notify, Semaphore};
131-
use tokio::time::{timeout, Duration};
131+
use tokio::time::{Duration, timeout};
132132

133133
#[derive(Clone)]
134134
struct BlockingSender {

arancini-lib/src/state.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use tracing::{debug, trace};
1212

1313
use crate::sender::UpdateSender;
1414
use crate::state_store::store::StateStore;
15-
use crate::update::{map_to_ipv6, Update, UpdateAttributes, UpdateMetadata};
15+
use crate::update::{Update, UpdateAttributes, UpdateMetadata, map_to_ipv6};
1616

1717
pub type AsyncState<T> = Arc<Mutex<State<T>>>;
1818
pub type RouterPeerUpdate = (IpAddr, IpAddr, TimedPrefix);
@@ -243,7 +243,7 @@ mod tests {
243243
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
244244
use std::sync::atomic::{AtomicUsize, Ordering};
245245
use tokio::sync::{Notify, Semaphore};
246-
use tokio::time::{sleep, timeout, Duration};
246+
use tokio::time::{Duration, sleep, timeout};
247247

248248
#[derive(Clone)]
249249
struct BlockingSender {

arancini/src/arancini.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use anyhow::Result;
22
use arancini_lib::processor::decode_bmp_message;
33
use arancini_lib::sender::UpdateSender;
4-
use arancini_lib::state::{synthesize_withdraw_update, State};
4+
use arancini_lib::state::{State, synthesize_withdraw_update};
55
use arancini_lib::state_store::memory::MemoryStore;
66
use arancini_lib::state_store::store::StateStore;
7-
use arancini_lib::update::{decode_updates, new_metadata, Update, UpdateMetadata};
7+
use arancini_lib::update::{Update, UpdateMetadata, decode_updates, new_metadata};
88
use async_nats::jetstream;
99
use bgpkit_parser::bmp::messages::{PeerDownNotification, RouteMonitoring};
1010
use bgpkit_parser::parser::bmp::messages::BmpMessageBody;
@@ -20,8 +20,8 @@ use monoio::io::AsyncReadRent;
2020
use monoio::net::{ListenerOpts, TcpListener, TcpStream};
2121
use monoio::time::sleep;
2222
use monoio::{FusionDriver, RuntimeBuilder};
23-
use std::collections::hash_map::Entry;
2423
use std::collections::HashMap;
24+
use std::collections::hash_map::Entry;
2525
use std::net::{IpAddr, SocketAddr};
2626
use std::sync::Arc;
2727
use std::sync::Mutex;
@@ -665,8 +665,7 @@ async fn handle_connection<S: UpdateSender>(
665665

666666
trace!(
667667
"{}: arancini read BMP packet ({} bytes)",
668-
socket,
669-
packet_length
668+
socket, packet_length
670669
);
671670
let mut bytes = frame_buffer.split_to(packet_length).freeze();
672671
if let Err(err) =
@@ -1472,7 +1471,7 @@ mod tests {
14721471
use std::net::{Ipv4Addr, SocketAddr};
14731472
use std::sync::atomic::{AtomicUsize, Ordering};
14741473
use tokio::sync::{Notify, Semaphore};
1475-
use tokio::time::{timeout, Duration};
1474+
use tokio::time::{Duration, timeout};
14761475

14771476
#[derive(Clone)]
14781477
struct BlockingSender {

arancini/src/bin/arancini_bench.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ mod update_capnp;
55

66
use arancini_lib::state::State;
77
use arancini_lib::state_store::memory::MemoryStore;
8-
use arancini_lib::update::{map_to_ipv6, Update, UpdateAttributes};
8+
use arancini_lib::update::{Update, UpdateAttributes, map_to_ipv6};
99
use bytes::BytesMut;
1010
use chrono::Utc;
1111
use core_affinity::CoreId;

arancini/src/bridge.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use arancini_lib::update::Update;
44
use async_nats::jetstream;
55
use crossfire::mpsc;
66
use crossfire::{AsyncRxTrait, AsyncTxTrait};
7-
use futures::stream::{FuturesUnordered, StreamExt};
87
use futures::FutureExt;
8+
use futures::stream::{FuturesUnordered, StreamExt};
99
use metrics::{counter, gauge, histogram};
1010
use std::future::Future;
1111
use std::net::IpAddr;
@@ -300,7 +300,7 @@ mod tests {
300300
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
301301
use std::sync::Arc;
302302
use tokio::sync::mpsc;
303-
use tokio::time::{timeout, Duration};
303+
use tokio::time::{Duration, timeout};
304304

305305
fn test_update(router_addr: IpAddr, prefix_addr: IpAddr, announced: bool) -> Update {
306306
Update {

arancini/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ use anyhow::Result;
1010
use futures::future::pending;
1111
use std::sync::Arc;
1212
use std::time::Duration;
13-
use tokio::sync::mpsc::{channel, Receiver};
13+
use tokio::sync::mpsc::{Receiver, channel};
1414
use tokio_graceful::Shutdown;
1515
use tracing::{debug, error, trace, warn};
1616

1717
use arancini_lib::update::Update;
1818

1919
use crate::bridge::BridgeSender;
20-
use crate::config::{configure, AppConfig};
20+
use crate::config::{AppConfig, configure};
2121

2222
async fn arancini_handler(cfg: Arc<AppConfig>, tx: BridgeSender) {
2323
if let Err(err) = arancini::spawn_workers(cfg, tx) {

arancini/src/producer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use anyhow::Result;
22
use arancini_lib::update::Update;
3-
use futures::stream::{FuturesUnordered, StreamExt};
43
use futures::FutureExt;
4+
use futures::stream::{FuturesUnordered, StreamExt};
55
use metrics::counter;
66
use rdkafka::config::ClientConfig;
77
use rdkafka::error::{KafkaError, RDKafkaErrorCode};

0 commit comments

Comments
 (0)