add Output::write_string; rename Writer::write → write_data#386
Open
bobzhang wants to merge 2 commits into
Open
add Output::write_string; rename Writer::write → write_data#386bobzhang wants to merge 2 commits into
Output::write_string; rename Writer::write → write_data#386bobzhang wants to merge 2 commits into
Conversation
Mirrors the helper added to `ServerConnection` so that string
interpolation can be streamed directly into `@stdio.stdout` /
`@stdio.stderr` via `out <+ "hello \{x}"`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Coverage Report for CI Build 345Coverage increased (+0.01%) to 79.362%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
`write(&Data)` is renamed to `write_data(&Data)` on the `@io.Writer` trait, with a deprecated `write` shim kept for backwards compatibility. This frees up the `write` name for a future `Show`-based overload that will let `<+` interpolation render any value. Internal call sites are migrated mechanically. `<+` macro expansions in `examples/http_file_server` still resolve to the deprecated `write` and will be cleaned up when the Show-based `write` lands. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Output::write_string for <+ sugarOutput::write_string; rename Writer::write → write_data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two related changes (commits separated for review):
Output::write_stringon@stdio.Output— mirror of the helper introduced forServerConnectionin ff28856, soout <+ "hello \{x}"resolves on stdio/stderr.Writer::write(&Data)→write_data(&Data)on the@io.Writertrait, with a#deprecatedwritealias kept for backwards compatibility. This frees up thewritename for a futurefn[A: Show] write(Self, A)overload, at which point<+can render any value (not just&Data-implementing types).The internal call sites (~280) are migrated mechanically from
.write(...)to.write_data(...).<+macro expansions inexamples/http_file_serverstill hit the deprecatedwrite(7 warnings) and will be cleaned up when the Show-based overload lands in a follow-up.Test plan
moon check— 0 errors; 8 expected deprecation warnings (7 from<+in http_file_server, 1 from the deprecatedwriteshim's own body insrc/io/deprecated.mbt)moon test— 490/490 passioandstdio🤖 Generated with Claude Code