Skip to content

Fix a broken link to Pair::as_span#1112

Merged
tomtau merged 1 commit intopest-parser:masterfrom
jieyouxu:fix-broken-link
Sep 3, 2025
Merged

Fix a broken link to Pair::as_span#1112
tomtau merged 1 commit intopest-parser:masterfrom
jieyouxu:fix-broken-link

Conversation

@jieyouxu
Copy link
Contributor

@jieyouxu jieyouxu commented Sep 3, 2025

Noticed when reading https://docs.rs/pest/2.8.1/pest/struct.Span.html. I think this method was perhaps renamed at some point?

This seems to produce the right link at least locally, but I'm not 100%.

Summary by CodeRabbit

  • Documentation
    • Corrected a cross-reference in the span-related documentation to point to the appropriate API, improving accuracy and clarity for readers.
    • Clarifies how to access span information, reducing potential confusion when navigating the docs.
    • No functional, behavioral, or API changes; runtime behavior and integrations remain unaffected.
    • Improves developer experience by ensuring documentation navigation is consistent and up to date.

@jieyouxu jieyouxu requested a review from a team as a code owner September 3, 2025 01:44
@jieyouxu jieyouxu requested review from tomtau and removed request for a team September 3, 2025 01:44
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 3, 2025

Walkthrough

Documentation-only update in pest/src/span.rs adjusting a cross-reference from method.span to method.as_span. No code or API behavior changed.

Changes

Cohort / File(s) Summary of Changes
Docs cross-reference fix
pest/src/span.rs
Updated doc reference from method.span to method.as_span; no functional changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

I nibbled on docs with gentle care,
Swapped a span for as_span—now it’s fair.
No bytes were moved, no tests to run,
Just tidy trails beneath the sun.
Tap-tap, my paws commit and flee—
A tiny fix for clarity.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 2f2ba3d and cdb89e7.

📒 Files selected for processing (1)
  • pest/src/span.rs (1 hunks)
🔇 Additional comments (2)
pest/src/span.rs (2)

21-21: LGTM: correct anchor is method.as_span.

The updated intra-doc reference resolves to pest::iterators::Pair::as_span and matches the current docs on docs.rs. This fixes the broken link from method.span. (docs.rs)


21-21: Switch to path-based intra-doc links

  • In pest/src/span.rs (line 21), remove the reference-style URL
/// [`Pair`]: ./iterators/struct.Pair.html#method.as_span

and update the doc comment itself to use inline path links, e.g.

/// A span over a `&str`. It is created from either [`Position::span`] or [`Pair::as_span`].
  • Consider enforcing broken-link checks in CI with
RUSTDOCFLAGS="-D rustdoc::broken_intra_doc_links" cargo doc --no-deps

(verify manually, as the automated script couldn’t run in this environment)

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@tomtau tomtau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it may have been a typo (there was an old method into_span)

@tomtau tomtau enabled auto-merge (squash) September 3, 2025 02:17
@tomtau tomtau merged commit 3b7b917 into pest-parser:master Sep 3, 2025
9 of 11 checks passed
@jieyouxu jieyouxu deleted the fix-broken-link branch September 3, 2025 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants