diff --git a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/config/ServiceConfigGenerator.kt b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/config/ServiceConfigGenerator.kt index f6972f5e6a..bb0653f327 100644 --- a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/config/ServiceConfigGenerator.kt +++ b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/config/ServiceConfigGenerator.kt @@ -228,12 +228,25 @@ class ServiceConfigGenerator(private val customizations: List) -> std::fmt::Result { + let mut config = f.debug_struct("Builder"); + config.finish() + } + """, + ) + } + writer.rustBlock("impl Builder") { writer.docs("Constructs a config builder.") writer.rustTemplate("pub fn new() -> Self { Self::default() }") diff --git a/rust-runtime/aws-smithy-http/src/endpoint.rs b/rust-runtime/aws-smithy-http/src/endpoint.rs index d9d7844746..dcc1db18d7 100644 --- a/rust-runtime/aws-smithy-http/src/endpoint.rs +++ b/rust-runtime/aws-smithy-http/src/endpoint.rs @@ -9,7 +9,7 @@ use crate::endpoint::error::InvalidEndpointError; use crate::operation::error::BuildError; use http::uri::{Authority, Uri}; use std::borrow::Cow; -use std::fmt::Debug; +use std::fmt::{Debug, Formatter}; use std::result::Result as StdResult; use std::str::FromStr; use std::sync::Arc; @@ -23,7 +23,7 @@ pub use error::ResolveEndpointError; pub type Result = std::result::Result; /// Implementors of this trait can resolve an endpoint that will be applied to a request. -pub trait ResolveEndpoint: Debug + Send + Sync { +pub trait ResolveEndpoint: Send + Sync { /// Given some endpoint parameters, resolve an endpoint or return an error when resolution is /// impossible. fn resolve_endpoint(&self, params: &Params) -> Result; @@ -38,9 +38,15 @@ impl ResolveEndpoint for &'static str { } /// Endpoint Resolver wrapper that may be shared -#[derive(Clone, Debug)] +#[derive(Clone)] pub struct SharedEndpointResolver(Arc>); +impl Debug for SharedEndpointResolver { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + f.debug_struct("SharedEndpointResolver").finish() + } +} + impl SharedEndpointResolver { /// Create a new `SharedEndpointResolver` from `ResolveEndpoint` pub fn new(resolve_endpoint: impl ResolveEndpoint + 'static) -> Self { @@ -60,7 +66,7 @@ impl From>> for SharedEndpointResolver { } } -impl ResolveEndpoint for SharedEndpointResolver { +impl ResolveEndpoint for SharedEndpointResolver { fn resolve_endpoint(&self, params: &T) -> Result { self.0.resolve_endpoint(params) }