Warn on unreachable_pub lint

This makes it easier to track visibility/compatibility during review.
This commit is contained in:
Dirkjan Ochtman 2023-04-14 10:13:36 +02:00
parent 7024bcd7a5
commit 5371ba573a
6 changed files with 18 additions and 16 deletions

View File

@ -16,10 +16,10 @@ use crate::error::Error;
/// EPP Connection struct with some metadata for the connection /// EPP Connection struct with some metadata for the connection
pub(crate) struct EppConnection<C: Connector> { pub(crate) struct EppConnection<C: Connector> {
pub registry: String, pub(crate) registry: String,
connector: C, connector: C,
stream: C::Connection, stream: C::Connection,
pub greeting: String, pub(crate) greeting: String,
timeout: Duration, timeout: Duration,
// A request that is currently in flight // A request that is currently in flight
// //

View File

@ -82,11 +82,11 @@ fn deserialize_host_addrs_option<'xml>(
/// The `<hostAddr>` types domain or host transactions /// The `<hostAddr>` types domain or host transactions
#[derive(Debug, FromXml, ToXml)] #[derive(Debug, FromXml, ToXml)]
#[xml(rename = "hostAddr", ns(super::domain::XMLNS))] #[xml(rename = "hostAddr", ns(super::domain::XMLNS))]
pub(crate) struct HostAddr<'a> { struct HostAddr<'a> {
#[xml(attribute, rename = "ip")] #[xml(attribute, rename = "ip")]
pub ip_version: Option<Cow<'a, str>>, ip_version: Option<Cow<'a, str>>,
#[xml(direct)] #[xml(direct)]
pub address: Cow<'a, str>, address: Cow<'a, str>,
} }
impl From<&IpAddr> for HostAddr<'static> { impl From<&IpAddr> for HostAddr<'static> {

View File

@ -24,12 +24,12 @@ pub struct ServiceMenu {
#[derive(Debug, FromXml, PartialEq)] #[derive(Debug, FromXml, PartialEq)]
#[xml(ns(EPP_XMLNS), rename = "svcMenu")] #[xml(ns(EPP_XMLNS), rename = "svcMenu")]
struct FlattenedServiceMenu { struct FlattenedServiceMenu {
pub version: String, version: String,
pub lang: String, lang: String,
#[xml(rename = "objURI")] #[xml(rename = "objURI")]
pub obj_uris: Vec<String>, obj_uris: Vec<String>,
#[xml(rename = "svcExtension")] #[xml(rename = "svcExtension")]
pub svc_ext: Option<ServiceExtension<'static>>, svc_ext: Option<ServiceExtension<'static>>,
} }
impl<'xml> FromXml<'xml> for ServiceMenu { impl<'xml> FromXml<'xml> for ServiceMenu {

View File

@ -128,11 +128,11 @@ impl<'xml> FromXml<'xml> for Status {
/// The `<hostAddr>` types domain or host transactions /// The `<hostAddr>` types domain or host transactions
#[derive(Debug, FromXml, ToXml)] #[derive(Debug, FromXml, ToXml)]
#[xml(rename = "addr", ns(XMLNS))] #[xml(rename = "addr", ns(XMLNS))]
pub(crate) struct HostAddr<'a> { struct HostAddr<'a> {
#[xml(attribute, rename = "ip")] #[xml(attribute, rename = "ip")]
pub ip_version: Option<Cow<'a, str>>, ip_version: Option<Cow<'a, str>>,
#[xml(direct)] #[xml(direct)]
pub address: Cow<'a, str>, address: Cow<'a, str>,
} }
impl From<&IpAddr> for HostAddr<'static> { impl From<&IpAddr> for HostAddr<'static> {

View File

@ -32,6 +32,8 @@
//! You will usually want to start by initializing an [`EppClient`]. Refer to the example code //! You will usually want to start by initializing an [`EppClient`]. Refer to the example code
//! on that type for more information. //! on that type for more information.
#![warn(unreachable_pub)]
pub mod client; pub mod client;
pub mod common; pub mod common;
pub mod connection; pub mod connection;

View File

@ -25,12 +25,12 @@ pub trait Extension: ToXml + Debug {
/// Type corresponding to the `<command>` tag in an EPP XML request /// Type corresponding to the `<command>` tag in an EPP XML request
/// with an `<extension>` tag /// with an `<extension>` tag
pub(crate) struct CommandWrapper<'a, D, E> { pub(crate) struct CommandWrapper<'a, D, E> {
pub command: &'static str, command: &'static str,
/// The instance that will be used to populate the `<command>` tag /// The instance that will be used to populate the `<command>` tag
pub data: &'a D, data: &'a D,
/// The client TRID /// The client TRID
pub extension: Option<&'a E>, extension: Option<&'a E>,
pub client_tr_id: String, client_tr_id: String,
} }
impl<'a, E: Extension, D: Transaction<E>> CommandWrapper<'a, D, E> { impl<'a, E: Extension, D: Transaction<E>> CommandWrapper<'a, D, E> {