diff --git a/src/api/adapter/remote.rs b/src/api/adapter/remote.rs index 3f079db..ad53b32 100644 --- a/src/api/adapter/remote.rs +++ b/src/api/adapter/remote.rs @@ -1,9 +1,5 @@ +use crate::common::data::{ForwardingRuleConfig, ProxyRuleConfig, RecordingRuleConfig}; use std::{borrow::Borrow, net::SocketAddr, sync::Arc}; -use crate::{ - common::{ - data::{ForwardingRuleConfig, ProxyRuleConfig, RecordingRuleConfig} - }, -}; use crate::api::{ adapter::{ @@ -19,14 +15,12 @@ use async_trait::async_trait; use bytes::Bytes; use http::{Request, StatusCode}; -use crate::{ - common::{ - data::{ - ActiveForwardingRule, ActiveMock, ActiveProxyRule, ActiveRecording, ClosestMatch, - MockDefinition, RequestRequirements, - }, - http::HttpClient, +use crate::common::{ + data::{ + ActiveForwardingRule, ActiveMock, ActiveProxyRule, ActiveRecording, ClosestMatch, + MockDefinition, RequestRequirements, }, + http::HttpClient, }; pub struct RemoteMockServerAdapter { diff --git a/src/api/proxy.rs b/src/api/proxy.rs index 049b343..1d1e081 100644 --- a/src/api/proxy.rs +++ b/src/api/proxy.rs @@ -1,8 +1,8 @@ use crate::{ api::server::MockServer, common::{ - data::RequestRequirements, data::RecordingRuleConfig, + data::RequestRequirements, util::{write_file, Join}, }, When, diff --git a/src/api/server.rs b/src/api/server.rs index 950a9b5..18e4bb7 100644 --- a/src/api/server.rs +++ b/src/api/server.rs @@ -1,8 +1,6 @@ +use crate::api::spec::{Then, When}; #[cfg(feature = "remote")] use crate::api::RemoteMockServerAdapter; -use crate::api::{ - spec::{Then, When}, -}; #[cfg(feature = "remote")] use crate::common::http::HttpMockHttpClient; @@ -17,29 +15,24 @@ use crate::{ #[cfg(feature = "proxy")] use crate::{ - api::proxy::{ForwardingRuleBuilder, ForwardingRule, ProxyRuleBuilder, ProxyRule}, + api::proxy::{ForwardingRule, ForwardingRuleBuilder, ProxyRule, ProxyRuleBuilder}, common::{ - util::read_file_async, data::{ForwardingRuleConfig, ProxyRuleConfig}, + util::read_file_async, }, }; #[cfg(feature = "record")] -use crate::{ - api::{ - common::data::RecordingRuleConfig, - mock::MockSet, - proxy::{Recording, RecordingRuleBuilder} - }, +use crate::api::{ + common::data::RecordingRuleConfig, + mock::MockSet, + proxy::{Recording, RecordingRuleBuilder}, }; #[cfg(feature = "record")] -use std::{path::PathBuf}; - -use crate::{ - server::{state::HttpMockStateManager, HttpMockServerBuilder}, -}; +use std::path::PathBuf; +use crate::server::{state::HttpMockStateManager, HttpMockServerBuilder}; use crate::Mock; use async_object_pool::Pool; diff --git a/src/server/builder.rs b/src/server/builder.rs index 5b0ca71..249e7ff 100644 --- a/src/server/builder.rs +++ b/src/server/builder.rs @@ -1,13 +1,11 @@ #[cfg(any(feature = "proxy"))] use crate::common::http::{HttpClient, HttpMockHttpClient}; +#[cfg(any(feature = "record", feature = "record"))] +use crate::server::persistence::read_static_mock_definitions; #[cfg(feature = "https")] use crate::server::server::MockServerHttpsConfig; #[cfg(feature = "https")] use crate::server::tls::{CertificateResolverFactory, GeneratingCertificateResolverFactory}; -#[cfg(any(feature = "record", feature = "record"))] -use crate::server::{ - persistence::read_static_mock_definitions, -}; use crate::server::{ handler::HttpMockHandler, diff --git a/src/server/state.rs b/src/server/state.rs index ed17d9e..e558faf 100644 --- a/src/server/state.rs +++ b/src/server/state.rs @@ -15,11 +15,7 @@ use crate::{ }; #[cfg(feature = "record")] -use crate::{ - server::{ - persistence::{deserialize_mock_defs_from_yaml, serialize_mock_defs_to_yaml}, - }, -}; +use crate::server::persistence::{deserialize_mock_defs_from_yaml, serialize_mock_defs_to_yaml}; use crate::common::data::{ForwardingRuleConfig, ProxyRuleConfig, RecordingRuleConfig}; use bytes::Bytes;