Improve indentation handling in renumber_lists#72
Conversation
Reviewer's GuideOptimize renumber_lists by slicing leading whitespace instead of allocating a String for indentation measurement File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Summary by CodeRabbit
WalkthroughRefactor the Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant renumber_lists
Caller->>renumber_lists: Call with input lines
renumber_lists->>renumber_lists: Find index of first non-whitespace char
renumber_lists->>renumber_lists: Slice original line for indentation
renumber_lists->>renumber_lists: Measure indentation length
renumber_lists-->>Caller: Return processed lines
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)**/*.rsInstructions used from: Sources:
⚙️ CodeRabbit Configuration File 🔇 Additional comments (1)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Hey @leynos - I've reviewed your changes and found some issues that need to be addressed.
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Summary
renumber_listsby slicing the leading whitespace instead of allocating aStringTesting
make fmtmake lintmake testhttps://chatgpt.com/codex/tasks/task_e_68763897bcc883229487e1c8e853443b
Summary by Sourcery
Enhancements: