Skip to content

Add impl Clone for Client#104

Merged
kixelated merged 1 commit intomoq-dev:mainfrom
teohhanhui:fix/impl-clone-for-client
Oct 7, 2025
Merged

Add impl Clone for Client#104
kixelated merged 1 commit intomoq-dev:mainfrom
teohhanhui:fix/impl-clone-for-client

Conversation

@teohhanhui
Copy link
Contributor

@teohhanhui teohhanhui commented Oct 7, 2025

No description provided.

@coderabbitai
Copy link

coderabbitai bot commented Oct 7, 2025

Walkthrough

Public Client types gained Clone and Debug derives in multiple locations: web-transport-quinn/src/client.rs, web-transport/src/quinn.rs, web-transport/src/wasm.rs, and web-transport-wasm/src/client.rs (the latter now #[derive(Clone, Debug, Default)]). In web-transport-wasm/src/client.rs the ClientBuilder derive order changed to #[derive(Debug, Default)] and doc comments referencing WebTransportOptions were added to Client and ClientBuilder. No other API signatures or behavior were changed.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 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 in the pull request, which is adding Clone implementation for the Client structs across multiple modules. It is clear, concise, and directly related to the main change without extraneous information, making it easy for teammates to understand the primary modification at a glance.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • 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

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

@teohhanhui teohhanhui force-pushed the fix/impl-clone-for-client branch from 236775e to f97168d Compare October 7, 2025 13:27
@teohhanhui teohhanhui force-pushed the fix/impl-clone-for-client branch from f97168d to 36261ca Compare October 7, 2025 13:52
Copy link

@coderabbitai coderabbitai bot left a 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 (1)
web-transport-wasm/src/client.rs (1)

11-11: Consider consistent derive ordering (optional nitpick).

There's a minor inconsistency in derive attribute ordering between ClientBuilder (Debug, Default) and Client (Clone, Debug, Default). While this has no functional impact, using a consistent ordering convention (e.g., alphabetical or grouping by category) improves readability.

Apply this diff to make the ordering consistent:

-#[derive(Debug, Default)]
+#[derive(Default, Debug)]
 pub struct ClientBuilder {

Also applies to: 70-70

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f97168d and 36261ca.

📒 Files selected for processing (4)
  • web-transport-quinn/src/client.rs (1 hunks)
  • web-transport-wasm/src/client.rs (2 hunks)
  • web-transport/src/quinn.rs (1 hunks)
  • web-transport/src/wasm.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • web-transport-quinn/src/client.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: build
🔇 Additional comments (4)
web-transport/src/quinn.rs (1)

50-50: LGTM! Clone and Debug enables useful functionality.

Adding Clone and Debug derives to Client is appropriate for a handle type, enabling users to clone client instances and print debug information.

web-transport/src/wasm.rs (1)

51-51: LGTM! Consistent with other Client implementations.

Adding Clone and Debug derives aligns this implementation with the quinn-based Client and enables the same useful functionality for WASM targets.

web-transport-wasm/src/client.rs (2)

10-11: LGTM! Helpful documentation addition.

The doc comment referencing WebTransportOptions provides useful context for users of ClientBuilder.


68-70: LGTM! Clone support enables flexible client usage.

Adding Clone derive to Client is appropriate since WebTransportOptions from web_sys implements Clone (via wasm-bindgen's JS object reference cloning). The documentation addition helpfully references the underlying options type.

@kixelated kixelated merged commit 625a54b into moq-dev:main Oct 7, 2025
1 check passed
@github-actions github-actions bot mentioned this pull request Oct 4, 2025
This was referenced Feb 18, 2026
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