Skip to content

Conversation

@rom1v
Copy link
Contributor

@rom1v rom1v commented Oct 16, 2025

Fix the following warning:

warning: hiding a lifetime that's elided elsewhere is confusing
help: the same lifetime is referred to in inconsistent ways, making the signature confusing
help: use '_ for type paths

Summary by CodeRabbit

Release Notes

  • Refactor
    • Refined internal API type signatures for improved code clarity and maintainability. No functional changes or impact on behavior.

Fix the following warning:

> warning: hiding a lifetime that's elided elsewhere is confusing
> help: the same lifetime is referred to in inconsistent ways, making
>       the signature confusing
> help: use `'_` for type paths
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 16, 2025

Walkthrough

This pull request updates public API method signatures across two files to incorporate lifetime annotations on Path return types. In rs/moq/src/model/origin.rs, both OriginProducer and OriginConsumer traits have their root, allowed, and absolute method signatures modified to use Path<'_> instead of Path in their return types. Additionally, in rs/moq/src/session/subscriber.rs, the log_path method's return type is similarly updated. These are purely type signature changes with no modifications to control flow, behavior, or error handling.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly describes the primary change, which is addressing hidden lifetime warnings by adding explicit lifetime annotations; it is both clear and directly aligned with the modifications in the code.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b905598 and c1598c3.

📒 Files selected for processing (2)
  • rs/moq/src/model/origin.rs (2 hunks)
  • rs/moq/src/session/subscriber.rs (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
rs/**/src/**/*.rs

📄 CodeRabbit inference engine (CLAUDE.md)

Write Rust tests integrated within source files (unit tests alongside code).

Files:

  • rs/moq/src/session/subscriber.rs
  • rs/moq/src/model/origin.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Check
🔇 Additional comments (8)
rs/moq/src/model/origin.rs (7)

425-427: LGTM: Explicit lifetime annotation correctly fixes the compiler warning.

The '_ annotation makes the implicit lifetime explicit, resolving the "hiding a lifetime that's elided elsewhere" warning.


429-431: LGTM: Consistent lifetime annotation in iterator return type.

The explicit '_ lifetime in the iterator's item type aligns with the other method signatures.


434-436: LGTM: Owned Path return type now includes explicit lifetime.

The Path<'_> return type correctly indicates the lifetime relationship with the input parameter.


515-517: LGTM: Consistent with OriginProducer changes.

The OriginConsumer trait mirrors the lifetime annotations added to OriginProducer.


519-521: LGTM: Iterator lifetime annotation matches OriginProducer.

Consistent application of explicit lifetimes across both producer and consumer traits.


524-526: LGTM: Final signature update completes the consistency.

All Path return types across both traits now have explicit lifetime annotations.


425-526: All Path return types in the codebase already have explicit lifetime annotations—verification confirms the changes are complete.

The search results show that all public methods returning Path types across the codebase (in path.rs, origin.rs, announce.rs, etc.) consistently use explicit lifetime annotations like Path<'_> or Path<'a>. The methods at lines 425, 434, 515, and 524 in origin.rs follow this established pattern. No additional updates are needed.

rs/moq/src/session/subscriber.rs (1)

301-303: LGTM: Lifetime annotation aligns with updated origin.rs signatures.

The Path<'_> return type correctly propagates the lifetime from root().join(path), matching the updated OriginProducer::root signature in origin.rs.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

@kixelated kixelated merged commit 487999c into moq-dev:main Oct 16, 2025
1 check passed
@moq-bot moq-bot bot mentioned this pull request Oct 13, 2025
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