Skip to content

Simplify hazmat feature docs#1643

Merged
leighmcculloch merged 1 commit intomainfrom
fix-hazmat-feature-docs
Dec 15, 2025
Merged

Simplify hazmat feature docs#1643
leighmcculloch merged 1 commit intomainfrom
fix-hazmat-feature-docs

Conversation

@leighmcculloch
Copy link
Copy Markdown
Member

@leighmcculloch leighmcculloch commented Dec 15, 2025

What

Remove hazmat feature from doc cfg attributes, keeping only the specific hazmat-address and hazmat-crypto features in documentation.

Before

Screenshot 2025-12-15 at 4 05 12 pm

After

Screenshot 2025-12-15 at 4 05 58 pm

Why

The generic hazmat feature is used for compilation gating, but really only exists historically for backwards compatibility and as something used for testing during development of the SDK. Generally folks should use the narrower scoped hazmat features, so showing it in documentation guides folks to do the not best practice, which results in enabling more hazmat APIs than are necessary.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR simplifies the documentation configuration attributes for hazmat features by removing redundant references to the generic hazmat feature, keeping only the specific granular features (hazmat-crypto and hazmat-address). This change guides users toward best practices by exposing only the minimal necessary hazmat APIs in documentation.

  • Removes any(feature = "hazmat", feature = "hazmat-crypto") in favor of just feature = "hazmat-crypto" in doc attributes
  • Removes any(feature = "hazmat", feature = "hazmat-address") in favor of just feature = "hazmat-address" in doc attributes
  • Maintains backward compatibility as the generic hazmat feature still enables all sub-features for compilation

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
soroban-sdk/src/env.rs Simplified doc cfg for crypto_hazmat() method to show only hazmat-crypto feature
soroban-sdk/src/crypto.rs Simplified doc cfg for CryptoHazmat struct to show only hazmat-crypto feature
soroban-sdk/src/address_payload.rs Simplified module-level doc cfg to show only hazmat-address feature
soroban-sdk/src/address.rs Simplified doc cfg for to_payload() and from_payload() methods to show only hazmat-address feature

@leighmcculloch leighmcculloch marked this pull request as ready for review December 15, 2025 06:06
@leighmcculloch leighmcculloch added this pull request to the merge queue Dec 15, 2025
Merged via the queue into main with commit 8219d77 Dec 15, 2025
100 of 101 checks passed
@leighmcculloch leighmcculloch deleted the fix-hazmat-feature-docs branch December 15, 2025 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants