Skip to content

refactor: use std::fmt::Write for printer output - #16

Merged
intellild merged 1 commit into
codex/rstack-fix-bundler-source-indicesfrom
codex/rstack-printer-write
Nov 9, 2026
Merged

intellild merged 1 commit into
codex/rstack-fix-bundler-source-indicesfrom
codex/rstack-printer-write

Conversation

@intellild

@intellild intellild commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Make Printer use std::fmt::Write as its output interface.
  • Track line and column state for multiline write_str calls in the Write implementation.
  • Replace explicit .map_err(Into::into) adapters with ?-based error propagation.
  • Update serializers, derives, examples, and custom at-rule tests to use the standard write methods.

Example

A serializer can now write through the standard formatting interface:

use std::fmt::Write;

printer.write_str("a\nb")?;
printer.write_char(';')?;
Ok(())

The printer keeps source-map line and column state correct even when one write_str call contains newlines.

Validation

  • cargo check --workspace --all-features
  • cargo fmt --all -- --check

Stack

  1. Fix bundled source-map indices
  2. This PR
  3. Serialize CSS through PrinterTrait
  4. Introduce the custom_sourcemap feature flag
  5. Custom source maps through generic PrinterOptions

by OpenAI Codex

Copilot AI balanced review requested due to automatic review settings November 4, 2026 06:52
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T06:54:00.759396Z 8bfdc10 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@codspeed

codspeed Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 8 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing codex/rstack-printer-write (f077386) with codex/rstack-fix-bundler-source-indices (b391f63)

Open in CodSpeed

Footnotes

  1. 8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@intellild
intellild added this pull request to stack #19 November 4, 2026 06:57
@intellild
intellild force-pushed the codex/rstack-printer-write branch from 8bfdc10 to 1aa7bde Compare November 4, 2026 07:06
@intellild
intellild removed this pull request from stack #19 November 4, 2026 09:03
@intellild
intellild added this pull request to stack #21 November 4, 2026 09:04
@intellild
intellild removed this pull request from stack #21 November 4, 2026 09:34
@intellild
intellild changed the base branch from master to codex/rstack-fix-bundler-source-indices November 4, 2026 09:34
@intellild
intellild force-pushed the codex/rstack-printer-write branch from 1aa7bde to f077386 Compare November 4, 2026 09:35
@intellild
intellild added this pull request to stack #24 November 5, 2026 02:22
@intellild
intellild merged commit 32ac974 into master Nov 9, 2026
5 of 6 checks passed
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.

2 participants