Skip to content

Commit a754a41

Browse files
committed
fmt
Signed-off-by: Gal Ovadia <ggalovadia@gmail.com>
1 parent 898d8d8 commit a754a41

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

rust/src/dns_gateway/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ pub mod cache_lookup;
1111
mod proto;
1212
mod virtual_ip_cache;
1313

14-
use virtual_ip_cache::{get_cache, init_cache, Destination};
1514
use envoy_proxy_dynamic_modules_rust_sdk::*;
1615
use hickory_proto::op::{Message, MessageType, ResponseCode};
1716
use hickory_proto::rr::{Name, RData, Record, RecordType};
1817
use hickory_proto::serialize::binary::{BinDecodable, BinDecoder};
1918
use std::collections::HashMap;
2019
use std::net::Ipv4Addr;
2120
use std::sync::Arc;
21+
use virtual_ip_cache::{get_cache, init_cache, Destination};
2222

2323
#[derive(Clone)]
2424
struct DomainMatcher {

rust/src/dns_gateway/virtual_ip_cache.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ impl VirtualIpCache {
8888
if *offset >= self.capacity {
8989
envoy_log_error!(
9090
"IP allocation exhausted, tried to allocate #{} but max is {}",
91-
*offset, self.capacity
91+
*offset,
92+
self.capacity
9293
);
9394
return None;
9495
}

rust/src/lib.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,6 @@ fn new_http_filter_config_fn<EC: EnvoyHttpFilterConfig, EHF: EnvoyHttpFilter>(
111111
}
112112
}
113113

114-
115-
116114
/// This implements the [`envoy_proxy_dynamic_modules_rust_sdk::NewNetworkFilterConfigFunction`].
117115
///
118116
/// This is the entrypoint every time a new Network filter is created via the DynamicModuleNetworkFilter config.
@@ -127,10 +125,11 @@ fn new_network_filter_config_fn<EC: EnvoyNetworkFilterConfig, ENF: EnvoyNetworkF
127125
filter_config: &[u8],
128126
) -> Option<Box<dyn NetworkFilterConfig<ENF>>> {
129127
match filter_name {
130-
"cache_lookup" => {
131-
Some(Box::new(dns_gateway::cache_lookup::CacheLookupFilterConfig::new(filter_config))
132-
as Box<dyn NetworkFilterConfig<ENF>>)
133-
}
128+
"cache_lookup" => Some(
129+
Box::new(dns_gateway::cache_lookup::CacheLookupFilterConfig::new(
130+
filter_config,
131+
)) as Box<dyn NetworkFilterConfig<ENF>>,
132+
),
134133
_ => panic!("Unknown network filter name: {filter_name}"),
135134
}
136135
}

0 commit comments

Comments
 (0)