From 5371ba573af91001b3cfa8c8ed85194dfb8a95fd Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Fri, 14 Apr 2023 10:13:36 +0200 Subject: [PATCH] Warn on unreachable_pub lint This makes it easier to track visibility/compatibility during review. --- src/connection.rs | 4 ++-- src/domain/mod.rs | 6 +++--- src/hello.rs | 8 ++++---- src/host/mod.rs | 6 +++--- src/lib.rs | 2 ++ src/request.rs | 8 ++++---- 6 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/connection.rs b/src/connection.rs index 87f85ed..418e796 100644 --- a/src/connection.rs +++ b/src/connection.rs @@ -16,10 +16,10 @@ use crate::error::Error; /// EPP Connection struct with some metadata for the connection pub(crate) struct EppConnection { - pub registry: String, + pub(crate) registry: String, connector: C, stream: C::Connection, - pub greeting: String, + pub(crate) greeting: String, timeout: Duration, // A request that is currently in flight // diff --git a/src/domain/mod.rs b/src/domain/mod.rs index d553307..20865b4 100644 --- a/src/domain/mod.rs +++ b/src/domain/mod.rs @@ -82,11 +82,11 @@ fn deserialize_host_addrs_option<'xml>( /// The `` types domain or host transactions #[derive(Debug, FromXml, ToXml)] #[xml(rename = "hostAddr", ns(super::domain::XMLNS))] -pub(crate) struct HostAddr<'a> { +struct HostAddr<'a> { #[xml(attribute, rename = "ip")] - pub ip_version: Option>, + ip_version: Option>, #[xml(direct)] - pub address: Cow<'a, str>, + address: Cow<'a, str>, } impl From<&IpAddr> for HostAddr<'static> { diff --git a/src/hello.rs b/src/hello.rs index 8a35fa3..88a1f49 100644 --- a/src/hello.rs +++ b/src/hello.rs @@ -24,12 +24,12 @@ pub struct ServiceMenu { #[derive(Debug, FromXml, PartialEq)] #[xml(ns(EPP_XMLNS), rename = "svcMenu")] struct FlattenedServiceMenu { - pub version: String, - pub lang: String, + version: String, + lang: String, #[xml(rename = "objURI")] - pub obj_uris: Vec, + obj_uris: Vec, #[xml(rename = "svcExtension")] - pub svc_ext: Option>, + svc_ext: Option>, } impl<'xml> FromXml<'xml> for ServiceMenu { diff --git a/src/host/mod.rs b/src/host/mod.rs index b39d873..fb3e139 100644 --- a/src/host/mod.rs +++ b/src/host/mod.rs @@ -128,11 +128,11 @@ impl<'xml> FromXml<'xml> for Status { /// The `` types domain or host transactions #[derive(Debug, FromXml, ToXml)] #[xml(rename = "addr", ns(XMLNS))] -pub(crate) struct HostAddr<'a> { +struct HostAddr<'a> { #[xml(attribute, rename = "ip")] - pub ip_version: Option>, + ip_version: Option>, #[xml(direct)] - pub address: Cow<'a, str>, + address: Cow<'a, str>, } impl From<&IpAddr> for HostAddr<'static> { diff --git a/src/lib.rs b/src/lib.rs index f3ca694..0d69a35 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -32,6 +32,8 @@ //! You will usually want to start by initializing an [`EppClient`]. Refer to the example code //! on that type for more information. +#![warn(unreachable_pub)] + pub mod client; pub mod common; pub mod connection; diff --git a/src/request.rs b/src/request.rs index 300fa32..8c284dd 100644 --- a/src/request.rs +++ b/src/request.rs @@ -25,12 +25,12 @@ pub trait Extension: ToXml + Debug { /// Type corresponding to the `` tag in an EPP XML request /// with an `` tag pub(crate) struct CommandWrapper<'a, D, E> { - pub command: &'static str, + command: &'static str, /// The instance that will be used to populate the `` tag - pub data: &'a D, + data: &'a D, /// The client TRID - pub extension: Option<&'a E>, - pub client_tr_id: String, + extension: Option<&'a E>, + client_tr_id: String, } impl<'a, E: Extension, D: Transaction> CommandWrapper<'a, D, E> {