From 8839eb4a11e49a2d40495524b32877cd8d6d2c61 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Wed, 1 Dec 2021 14:01:39 +0100 Subject: [PATCH] Keep struct definitions and impl blocks together --- epp-client/src/config.rs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/epp-client/src/config.rs b/epp-client/src/config.rs index 7db8059..197c568 100644 --- a/epp-client/src/config.rs +++ b/epp-client/src/config.rs @@ -57,6 +57,19 @@ pub struct EppClientTlsFiles { pub key: String, } +/// Config that stores settings for multiple registries +#[derive(Serialize, Deserialize, Debug)] +pub struct EppClientConfig { + pub registry: HashMap, +} + +impl EppClientConfig { + /// Returns the config for a particular registry + pub fn registry(&self, registry: &str) -> Option<&EppClientConnection> { + self.registry.get(registry) + } +} + /// Connection details to connect to and authenticate with a registry #[derive(Serialize, Deserialize, Debug)] pub struct EppClientConnection { @@ -68,12 +81,6 @@ pub struct EppClientConnection { pub tls_files: Option, } -/// Config that stores settings for multiple registries -#[derive(Serialize, Deserialize, Debug)] -pub struct EppClientConfig { - pub registry: HashMap, -} - impl EppClientConnection { /// Returns the EPP host and port no as a tuple pub fn connection_details(&self) -> (String, u16) { @@ -136,10 +143,3 @@ impl EppClientConnection { Err(Error::Other("No private key found in PEM file".to_owned())) } } - -impl EppClientConfig { - /// Returns the config for a particular registry - pub fn registry(&self, registry: &str) -> Option<&EppClientConnection> { - self.registry.get(registry) - } -}