Skip to content

docs: show Display forwarding in #[from] example - #460

Open
SatvikMishra08 wants to merge 1 commit into
dtolnay:masterfrom
SatvikMishra08:docs/135-from-example
Open

SatvikMishra08 wants to merge 1 commit into
dtolnay:masterfrom
SatvikMishra08:docs/135-from-example

Conversation

@SatvikMishra08

Copy link
Copy Markdown

Fixes #135.

Docs-only clarification for #[from] + Display:

  • Update the top Disconnect example to #[error("data store disconnected: {0}")] so the source’s Display is forwarded into the message
  • Note under the #[from] details that {0} / {var} interpolates the source field

Does not change the opaque PublicError / forwarding-From docs (unrelated to #439 / #456).

Fixes dtolnay#135.

Clarify that #[error("... {0}")] interpolates the #[from] source's
Display output, matching the common Disconnect pattern.
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.

Improve #[from] documentation example.

1 participant