-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
src/node/iters.rs: fixed DescendantNodes
#68
Conversation
WalkthroughThis pull request updates the Changes
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #68 +/- ##
==========================================
- Coverage 92.22% 92.16% -0.07%
==========================================
Files 16 16
Lines 2741 2745 +4
==========================================
+ Hits 2528 2530 +2
- Misses 213 215 +2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
tests/node-traversal.rs (1)
133-148
: Consider adding more test cases.The test correctly verifies the basic functionality. Consider adding edge cases such as:
- A node with no descendants
- A node with only one descendant
- A node with multiple levels of descendants but no siblings
Would you like me to help generate these additional test cases?
CHANGELOG.md (1)
14-15
: Consider removing word duplication.The entry correctly describes the fix, but there's a minor duplication of the word "Fixed". Consider this revision:
-### Fixed -- Fixed an issue where `DescendantNodes` could traverse beyond the initial node when iterating over descendants. This affected `NodeRef::descendants` and `NodeRef::descendants_it`. +### Fixed +- Issue where `DescendantNodes` could traverse beyond the initial node when iterating over descendants. This affected `NodeRef::descendants` and `NodeRef::descendants_it`.🧰 Tools
🪛 LanguageTool
[duplication] ~14-~14: Possible typo: you repeated a word.
Context: ...as possible,bit-set
was chosen. ### Fixed - Fixed an issue whereDescendantNodes
could ...(ENGLISH_WORD_REPEAT_RULE)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
CHANGELOG.md
(1 hunks)src/node/iters.rs
(3 hunks)tests/node-traversal.rs
(1 hunks)tests/selection-traversal.rs
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- tests/selection-traversal.rs
🧰 Additional context used
🪛 LanguageTool
CHANGELOG.md
[duplication] ~14-~14: Possible typo: you repeated a word.
Context: ...as possible, bit-set
was chosen. ### Fixed - Fixed an issue where DescendantNodes
could ...
(ENGLISH_WORD_REPEAT_RULE)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: test-wasm
🔇 Additional comments (3)
src/node/iters.rs (3)
148-148
: LGTM! Good addition of thestart_id
field.The field is necessary to track the initial node and prevent traversal beyond it.
168-168
: LGTM! Proper initialization ofstart_id
.The field is correctly initialized with the provided
node_id
.
180-182
: LGTM! Proper boundary check to prevent infinite traversal.The check correctly prevents traversal beyond the initial node by returning
None
when the parent matchesstart_id
.
DescendantNodes
could traverse beyond the initial node when iterating over descendants. This affectedNodeRef::descendants
andNodeRef::descendants_it
.Summary by CodeRabbit