Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs for non aws-config config builders #3960

Merged
merged 2 commits into from
Jan 3, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ class ServiceConfigGenerator(
}

fun render(writer: RustWriter) {
val configDocs = "Constructs a config builder. Note that a config created from this builder will not have the same safe defaults as one created by the [aws-config](https://crates.io/crates/aws-config) crate."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine but wonder if it's worth trying to make this a callout.

I can't find a doc.rs example but I recall seeing this before and this issue seems to indicate it's possible.

/// <div class="warning">
///
/// Warning text here
///
/// </div>

IDK maybe it's not worth it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in 4d722e1

Screenshot 2025-01-03 at 08 35 38

writer.docs("Configuration for a $moduleUseName service client.\n")
customizations.forEach {
it.section(ServiceConfig.ConfigStructAdditionalDocs)(writer)
Expand Down Expand Up @@ -426,7 +427,7 @@ class ServiceConfigGenerator(
writer.rustBlock("impl Config") {
writer.rustTemplate(
"""
/// Constructs a config builder.
/// $configDocs
pub fn builder() -> Builder { Builder::default() }
""",
)
Expand Down Expand Up @@ -483,7 +484,7 @@ class ServiceConfigGenerator(
}

writer.rustBlock("impl Builder") {
writer.docs("Constructs a config builder.")
writer.docs(configDocs)
writer.rust("pub fn new() -> Self { Self::default() }")

builderFromConfigBag()(this)
Expand Down
Loading