Document App::init() behavior with with_state constructors#212
Merged
ryanoneill merged 2 commits intomainfrom Mar 8, 2026
Merged
Document App::init() behavior with with_state constructors#212ryanoneill merged 2 commits intomainfrom
ryanoneill merged 2 commits intomainfrom
Conversation
Clarify that App::init() is not called when using with_state constructors (new_terminal_with_state, virtual_terminal_with_state, etc.), and that a stub implementation is sufficient in that case. Add module-level docs to src/app/model/mod.rs and src/app/mod.rs explaining the two construction patterns (standard vs external state). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove the `(self)` intra-doc link that pointed to a private module, which caused `cargo doc` to fail with `-D warnings`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
532cb69 to
8facc51
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #212 +/- ##
=======================================
Coverage 92.09% 92.09%
=======================================
Files 144 144
Lines 12754 12754
=======================================
Hits 11746 11746
Misses 1008 1008 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
src/app/model/mod.rsexplaining the two construction patterns (standard vs external state) and whenApp::init()is calledsrc/app/mod.rsmodule docs covering the same patternsApp::init()method docs to explain it is skipped bywith_stateconstructors and show a stub examplewith_stateruntime constructors interminal.rsandruntime/mod.rsAddresses feedback from external review (Claudio's Claude) noting that
App::init()being required when usingwith_stateis a paper cut.Test plan
cargo test --doc --all-featurespasses (787 doc tests)cargo clippy --all-features -- -D warningsclean🤖 Generated with Claude Code