Repository navigation
refactor(rtf): split the outline reader into per-construct methods (S3776) - #1399
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Parser state and entry point crates/format/src/rtf.rs |
St and Outline hold parser and formatting state. rtf_to_outline initializes and runs the parser, flushes the final line, and finishes surrogate pairs. |
Groups, controls, and Unicode handling crates/format/src/rtf.rs |
Parser methods handle groups, escapes, control words, Unicode units, fallback characters, and supported punctuation. |
Text scanning and outline output crates/format/src/rtf.rs |
Parser methods decode hex escapes, handle control symbols, scan plain text, and flush trimmed lines with calculated indentation. |
Priority:
Estimated code review effort: 2 (Simple) | ~15 minutes
Change: Refactor
Possibly related PRs
- storytold/deckcraft#1260: Introduces the RTF outline reader that this change refactors.
- storytold/deckcraft#1315: Changes skipped list destinations and indentation behavior in the same importer.
- storytold/deckcraft#1351: Changes hex-escape validation that this change moves into
Outline::hex_escape.
Suggested reviewers: nikitkara, aiongg
Merge Risk: 
Minimal · up to 3c2ea
-
No actionable issue is established for RTF import; the change is mergeable after normal checks.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed -
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
|

Cognitive complexity of rtf_to_outline was 88 (limit 30). The reader's state now lives in a struct, with one method per construct (groups, control words, \u and ' escapes, symbols, text, flush). Behaviour is unchanged; deckcraft-format's 40 tests pass.
Summary by CodeRabbit