You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The file src/wrap.rs contains 428 lines, exceeding the 400-line guideline from coding guidelines. Extract additional helpers into submodules to improve cohesion and comply with the file-length constraint.
Tasks
Extract wrap_preserving_code and related inline-code helpers (determine_token_span, merge_code_span, extend_punctuation, looks_like_link, is_whitespace_token, is_inline_code_token, is_trailing_punct, attach_punctuation_to_previous_line) into a new submodule src/wrap/inline.rs
Extract paragraph-level helpers (flush_paragraph, handle_prefix_line, append_wrapped_with_prefix) into src/wrap/paragraph.rs
Update src/wrap.rs to declare mod inline; and mod paragraph;
Update src/wrap.rs to use inline::wrap_preserving_code and paragraph::{flush_paragraph, handle_prefix_line} where needed
Adjust visibility to pub(super) or pub(crate) as appropriate
Run cargo test to ensure the refactored modules compile and all tests pass
Description
The file
src/wrap.rscontains 428 lines, exceeding the 400-line guideline from coding guidelines. Extract additional helpers into submodules to improve cohesion and comply with the file-length constraint.Tasks
wrap_preserving_codeand related inline-code helpers (determine_token_span,merge_code_span,extend_punctuation,looks_like_link,is_whitespace_token,is_inline_code_token,is_trailing_punct,attach_punctuation_to_previous_line) into a new submodulesrc/wrap/inline.rsflush_paragraph,handle_prefix_line,append_wrapped_with_prefix) intosrc/wrap/paragraph.rssrc/wrap.rsto declaremod inline;andmod paragraph;src/wrap.rsto useinline::wrap_preserving_codeandparagraph::{flush_paragraph, handle_prefix_line}where neededpub(super)orpub(crate)as appropriatecargo testto ensure the refactored modules compile and all tests passReference