Skip to content

Conversation

leynos
Copy link
Owner

@leynos leynos commented Jun 13, 2025

Summary

  • move extractor tests outside impl
  • rewrite middleware traits
  • add WireframeServer::new and cleanup comments

Testing

  • markdownlint docs/roadmap.md
  • nixie docs/roadmap.md
  • cargo fmt --all
  • cargo clippy -- -D warnings
  • cargo test -- --nocapture

https://chatgpt.com/codex/tasks/task_e_684bd1f2b88483229b0c3a91dfddccc8

Summary by Sourcery

Fix compilation errors and resolve Clippy warnings by adding missing constructors, refining middleware and extractor traits, annotating public APIs, and updating documentation with a runnable example.

New Features:

  • Add WireframeServer::new constructor to initialize server with a factory
  • Introduce Next::new constructor in middleware to wrap services
  • Implement From<Arc<T>> and From<T> for SharedState extractor

Enhancements:

  • Refactor middleware traits and streamline call and transform APIs
  • Add #[must_use] and #[inline] annotations to key public methods
  • Clean up duplicate and outdated doc comments across modules

Documentation:

  • Mark minimal example as completed and add a runnable example to docs/roadmap.md

Tests:

  • Move extractor tests outside of the impl block in extractor module

Summary by CodeRabbit

  • Documentation
    • Added a complete, runnable Rust example demonstrating core library usage.
    • Improved and clarified documentation for middleware and server components, with simplified comments and updated examples.
  • New Features
    • Made the SharedState constructor and Next middleware constructor publicly available for easier use in applications.
  • Style
    • Refined wording and structure in documentation for better clarity and conciseness.

Copy link
Contributor

sourcery-ai bot commented Jun 13, 2025

Reviewer's Guide

This PR refactors server, middleware, and extractor modules to resolve compile and Clippy issues by introducing dedicated constructors, inlining and must-use annotations, trait implementations, relocating tests, and updating documentation with a runnable example.

Class Diagram: Next<'a, S> with New Public new() Constructor and #[must_use] Annotations

classDiagram
  class Next~'a, S~ {
    <<generic S: Service + ?Sized>>
    #service: &'a S
    +new(service: &'a S) Next~'a, S~ // New public constructor, #[inline], #[must_use]
    +call(req: ServiceRequest) Result~ServiceResponse, S_Error~ // #[must_use = "await the returned future"]
  }
Loading

File-Level Changes

Change Details Files
Introduce WireframeServer::new constructor and method annotations
  • Add pub fn new(factory) with default CPU-based worker count
  • Annotate new and workers methods with #[must_use]
  • Remove outdated doc comments and examples
  • Adjust default workers logic to use num_cpus::get()
src/server.rs
Streamline Next API in middleware with inline and must-use
  • Add #[inline] and #[must_use] to Next::new
  • Refine call method with must_use message for awaiting the future
  • Remove redundant doc lines and duplicate type aliases
src/middleware.rs
Extend SharedState with constructors and From implementations
  • Add SharedState::new(inner: Arc) with #[must_use]
  • Implement From<Arc> and From for SharedState
  • Remove duplicate SharedState::new in test module and relocate tests
src/extractor.rs
Update roadmap documentation with runnable example
  • Mark minimal example checkbox as complete
  • Insert a complete Rust snippet demonstrating server usage
  • Ensure imports and async main function compile out of the box
docs/roadmap.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

coderabbitai bot commented Jun 13, 2025

Warning

Rate limit exceeded

@leynos has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 6 minutes and 53 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between be70314 and 771b951.

📒 Files selected for processing (4)
  • docs/roadmap.md (1 hunks)
  • src/extractor.rs (3 hunks)
  • src/middleware.rs (2 hunks)
  • src/server.rs (1 hunks)

Walkthrough

This update marks the "Provide a minimal, runnable example" checklist item as complete in the roadmap. It introduces a full Rust example for WireframeApp and WireframeServer usage, moves the SharedState::new constructor to the main implementation, and clarifies documentation and method visibility in middleware and server modules.

Changes

File(s) Change Summary
docs/roadmap.md Checklist item marked complete; added a full, minimal Rust example demonstrating WireframeApp and WireframeServer usage.
src/extractor.rs Moved SharedState::new constructor from test module to main implementation; updated example imports in docs.
src/middleware.rs Made Next::new public; clarified and simplified documentation for Next and call; improved Transform trait docs.
src/server.rs Condensed and clarified documentation for WireframeServer constructor and workers method; no logic changes.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant WireframeApp
    participant WireframeServer

    User->>WireframeApp: Define routes and handlers
    User->>WireframeServer: Create server with app factory
    WireframeServer->>WireframeServer: Set worker count
    User->>WireframeServer: Start server (run)
    WireframeServer->>WireframeApp: Handle incoming requests
Loading

Possibly related PRs

Poem

A runnable sample, clear and neat,
Now graces our roadmap’s feat.
Constructors moved, docs refined,
Middleware’s purpose well-defined.
With every hop and code review,
The framework grows—fast and true!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai 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

Documentation and Community

  • 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

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @leynos - I've reviewed your changes - here's some feedback:

  • Double-check that removing the transform method from Next doesn’t break your middleware trait implementations—re-expose or adapt it if it’s still required by Transform.
  • Verify that the new code snippet in docs/roadmap.md actually compiles against your public API (especially the Service alias and handler closure signature).
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Double-check that removing the `transform` method from `Next` doesn’t break your middleware trait implementations—re-expose or adapt it if it’s still required by `Transform`.
- Verify that the new code snippet in `docs/roadmap.md` actually compiles against your public API (especially the `Service` alias and handler closure signature).

## Individual Comments

### Comment 1
<location> `src/middleware.rs:34` </location>
<code_context>
-    /// assert!(res.is_ok());
-    /// ```
+    /// Propagates any error produced by the wrapped service.
     pub async fn call(&self, req: ServiceRequest) -> Result<ServiceResponse, S::Error> {
         self.service.call(req).await
     }
</code_context>

<issue_to_address>
Add `#[must_use]` to async call to catch ignored futures

This ensures that dropped or unawaited futures from `call` are flagged, preventing silent errors in middleware chains.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Contributor

@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 (7)
src/extractor.rs (2)

72-74: Consider providing ergonomic conversions in addition to new.

SharedState::new is fine, but every caller must already have an Arc<T>.
Providing From<Arc<T>> (and possibly From<T> that internally wraps with Arc::new) would make the type feel more “transparent” and avoid the extra clone-and-wrap ceremony.

+impl<T: Send + Sync> From<Arc<T>> for SharedState<T> {
+    fn from(inner: Arc<T>) -> Self {
+        Self(inner)
+    }
+}
+
+impl<T: Send + Sync> From<T> for SharedState<T> {
+    fn from(inner: T) -> Self {
+        Self(Arc::new(inner))
+    }
+}

108-114: Doc test could compile ‑ consider no_run instead of ignore.

The snippet now imports wireframe::extractor::SharedState, which should compile.
Switching from ignore to no_run will still skip execution but at least type-checks the example in CI.

-/// ```ignore
+/// ```no_run
src/middleware.rs (2)

23-27: Next::new looks good – suggest #[inline] for zero-cost wrapper.

The constructor is purely a field initialiser; adding #[inline] would let the optimiser remove the call overhead completely without affecting readability.

-    #[must_use]
+    #[inline]
+    #[must_use]

29-35: Clarify #[must_use] message on call.

The message says “call the returned future”, but the user actually needs to await it. A tiny wording tweak avoids confusion.

-    #[must_use = "call the returned future"]
+    #[must_use = "await the returned future"]
src/server.rs (2)

31-39: Minor redundancy in worker count initialisation.

num_cpus::get() never returns 0, so .max(1) is unnecessary.

-            workers: num_cpus::get().max(1),
+            workers: num_cpus::get(),

41-45: Builder ergonomics: allow mutating an existing value.

workers(self, count) consumes self, preventing users from conditionally setting it later in fluent chains. A &mut self receiver keeps the chaining style while offering flexibility:

-pub fn workers(mut self, count: usize) -> Self {
-    self.workers = count.max(1);
-    self
-}
+pub fn workers(&mut self, count: usize) -> &mut Self {
+    self.workers = count.max(1);
+    self
+}

Call-sites can still chain with ..workers(4).. thanks to the borrow checker.

docs/roadmap.md (1)

33-57: Tidy up the example imports.

std::{future::Future, pin::Pin} are unused after the recent edits. Removing them keeps the example minimal and avoids dead-code warnings.

-use std::{future::Future, pin::Pin};
+// No extra imports required
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 59b526b and be70314.

📒 Files selected for processing (4)
  • docs/roadmap.md (1 hunks)
  • src/extractor.rs (2 hunks)
  • src/middleware.rs (2 hunks)
  • src/server.rs (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: coverage

@leynos
Copy link
Owner Author

leynos commented Jun 13, 2025

@sourcery-ai review

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @leynos - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments

### Comment 1
<location> `src/server.rs:43` </location>
<code_context>
-    pub fn workers(mut self, count: usize) -> Self {
+    /// Set the number of worker tasks to spawn.
+    #[must_use]
+    pub fn workers(&mut self, count: usize) -> &mut Self {
         self.workers = count.max(1);
         self
</code_context>

<issue_to_address>
Builder method signature may break chaining on temporaries

With the new `&mut self` signature, you lose the ability to chain methods on temporaries. To keep fluent chaining, consider keeping the signature as `workers(self, count: usize) -> Self`.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@leynos
Copy link
Owner Author

leynos commented Jun 13, 2025

@sourcery-ai review

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @leynos - I've reviewed your changes - here's some feedback:

  • In WireframeServer::new you drop the .max(1) on the default worker count—consider adding .max(1) there as well to guarantee at least one worker, matching the behavior of the workers setter.
  • The minimal example in docs/roadmap.md imports Service as if it’s a concrete type—this may confuse users; either show a ready‐to‐use service implementation in the snippet or clarify the trait alias so the example compiles out of the box.
  • The diff in middleware.rs still shows duplicate type Wrapped and async fn transform declarations under the Next impl—clean up those leftovers so only the intended constructor and call methods remain.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In WireframeServer::new you drop the `.max(1)` on the default worker count—consider adding `.max(1)` there as well to guarantee at least one worker, matching the behavior of the `workers` setter.
- The minimal example in docs/roadmap.md imports `Service` as if it’s a concrete type—this may confuse users; either show a ready‐to‐use service implementation in the snippet or clarify the trait alias so the example compiles out of the box.
- The diff in middleware.rs still shows duplicate `type Wrapped` and `async fn transform` declarations under the `Next` impl—clean up those leftovers so only the intended constructor and call methods remain.

## Individual Comments

### Comment 1
<location> `src/server.rs:31` </location>
<code_context>
-    /// let server = WireframeServer::new(factory);
-    /// ```
-            workers: num_cpus::get().max(1),
+    /// Construct a new server using the supplied application factory.
+    #[must_use]
+    pub fn new(factory: F) -> Self {
</code_context>

<issue_to_address>
Include default worker count behavior in documentation

Please note in the documentation that the default worker count is determined by the number of CPU cores.
</issue_to_address>

<suggested_fix>
<<<<<<< SEARCH
    /// Construct a new server using the supplied application factory.
=======
    /// Construct a new server using the supplied application factory.
    ///
    /// By default, the number of worker threads is set to the number of CPU cores available.
>>>>>>> REPLACE

</suggested_fix>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

/// let server = WireframeServer::new(factory);
/// ```
workers: num_cpus::get().max(1),
/// Construct a new server using the supplied application factory.
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: Include default worker count behavior in documentation

Please note in the documentation that the default worker count is determined by the number of CPU cores.

Suggested change
/// Construct a new server using the supplied application factory.
/// Construct a new server using the supplied application factory.
///
/// By default, the number of worker threads is set to the number of CPU cores available.

@leynos
Copy link
Owner Author

leynos commented Jun 13, 2025

@coderabbitai issue:

In WireframeServer::new you drop the .max(1) on the default worker count—consider adding .max(1) there as well to guarantee at least one worker, matching the behavior of the workers setter.

Copy link
Contributor

coderabbitai bot commented Jun 13, 2025

Tip

For best results, initiate chat on the files or code changes.

@leynos Got it —this is a good catch. Would you like me to open a follow-up issue to track adding .max(1) in WireframeServer::new so the default worker count always remains at least one?
If yes, please let me know which issue-tracking platform you prefer (GitHub for this repo or your Linear workspace DF1).

@leynos
Copy link
Owner Author

leynos commented Jun 13, 2025

@coderabbitai

GitHub, please

Copy link
Contributor

coderabbitai bot commented Jun 13, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Create a follow-up issue on GitHub to track adding `.max(1)` in WireframeServer::new
gh issue create \
  --title "Ensure WireframeServer::new enforces minimum worker count of at least 1" \
  --body $'### Summary\n\n`WireframeServer::new` currently determines the default worker count with `num_cpus::get()` but no longer applies `.max(1)`. On platforms that may return `0`, this could leave the server without any worker tasks.  The `workers()` setter, however, *does* apply `.max(1)`.\n\nThis issue tracks reinstating the minimum-of-one safeguard in the constructor so behaviour is consistent across both code paths.\n\n### Context\n- Requested by @leynos during code review.\n- Pull request: https://github.com/leynos/wireframe/pull/11\n- Comment: Raised in the PR discussion (see link above).\n\n### Acceptance Criteria\n- `WireframeServer::new` guarantees at least one worker by applying `.max(1)` (or equivalent logic).\n- Appropriate test(s) cover the zero-CPU edge case, where feasible.\n' \
  --assignee leynos

Length of output: 954


@leynos The follow-up issue has been opened on GitHub ✅
👉 #12

Feel free to update the issue description or add any extra details as needed. 🐇

@leynos
Copy link
Owner Author

leynos commented Jun 13, 2025

@sourcery-ai review

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @leynos - I've reviewed your changes - here's some feedback:

  • Consider preserving the previous max(1) guard in WireframeServer::new (e.g. num_cpus::get().max(1)) to ensure at least one worker on edge platforms.
  • The Transform trait’s transform method could benefit from #[must_use] and #[inline] annotations similar to Next::new to encourage proper usage and performance.
  • Since you’ve implemented From<Arc> and From for SharedState, consider deprecating SharedState::new(inner: Arc) to avoid API duplication and unify the constructor pattern.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider preserving the previous max(1) guard in WireframeServer::new (e.g. num_cpus::get().max(1)) to ensure at least one worker on edge platforms.
- The Transform trait’s transform method could benefit from #[must_use] and #[inline] annotations similar to Next::new to encourage proper usage and performance.
- Since you’ve implemented From<Arc<T>> and From<T> for SharedState, consider deprecating SharedState::new(inner: Arc<T>) to avoid API duplication and unify the constructor pattern.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@leynos leynos merged commit 6b6f8c2 into main Jun 13, 2025
3 checks passed
@leynos leynos deleted the codex/provide-minimal-runnable-example branch June 13, 2025 14:34
@leynos
Copy link
Owner Author

leynos commented Jun 13, 2025

@coderabbitai

Please create the following github issues:

  • Consider preserving the previous max(1) guard in WireframeServer::new (e.g. num_cpus::get().max(1)) to ensure at least one worker on edge platforms.

  • The Transform trait’s transform method could benefit from #[must_use] and #[inline] annotations similar to Next::new to encourage proper usage and performance.

  • Since you’ve implemented From and From for SharedState, consider deprecating SharedState::new(inner: Arc) to avoid API duplication and unify the constructor pattern.

Copy link
Contributor

coderabbitai bot commented Jun 13, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# === Issue 1 ---------------------------------------------------------------
gh issue create \
  --title "Preserve .max(1) guard in WireframeServer::new to ensure at least one worker" \
  --body $'### Summary\n`WireframeServer::new` used to apply `.max(1)` to the default returned by `num_cpus::get()`, guaranteeing at least one worker task.  The recent refactor removed this guard.\n\n### Context\n- Requested by @leynos during review of PR https://github.com/leynos/wireframe/pull/11\n- Earlier discussion: https://github.com/leynos/wireframe/issues/12 (similar topic)\n\n### Acceptance Criteria\n- Constructor again guarantees a minimum of **1** worker (or equivalent logic).\n- Unit test (or doc-test) covers the zero-CPU edge case, if feasible.\n' \
  --assignee leynos

# === Issue 2 ---------------------------------------------------------------
gh issue create \
  --title "Annotate Transform::transform with #[must_use] and #[inline]" \
  --body $'### Summary\n`Transform::transform` currently lacks the `#[must_use]` and `#[inline]` annotations that were recently added to `Next::new`.  Aligning the annotations will:\n1. Encourage callers to use the returned middleware-wrapped service.\n2. Hint the compiler to inline small adaptor implementations for performance.\n\n### Context\n- Requested by @leynos during review of PR https://github.com/leynos/wireframe/pull/11\n\n### Acceptance Criteria\n- `Transform::transform` is annotated with `#[must_use]` (with an explanatory message) and `#[inline]`.\n- Documentation updated to reflect the change.\n' \
  --assignee leynos

# === Issue 3 ---------------------------------------------------------------
gh issue create \
  --title "Deprecate SharedState::new in favour of `From<Arc>` / `From<T>` impls" \
  --body $'### Summary\nWith `From<Arc<T>> for SharedState<T>` and `From<T> for SharedState<T>` now implemented, the `SharedState::new(inner: Arc<T>)` constructor duplicates functionality. Deprecating it will promote a uniform construction pattern and reduce API surface.\n\n### Context\n- Requested by @leynos during review of PR https://github.com/leynos/wireframe/pull/11\n\n### Acceptance Criteria\n- Mark `SharedState::new` as `#[deprecated(note = "construct via `inner.into()` instead")]` (or remove in a breaking release).\n- Update examples and docs to use the `From` conversions.\n- Provide a migration note in the changelog.\n' \
  --assignee leynos

Length of output: 2733


@leynos All three GitHub issues have been opened:

  1. Preserve .max(1) guard in WireframeServer::new
    Preserve .max(1) guard in WireframeServer::new to ensure at least one worker #13

  2. Annotate Transform::transform with #[must_use] and #[inline]
    Annotate Transform::transform with #[must_use] and #[inline] #14

  3. Deprecate SharedState::new in favour of the From conversions
    Deprecate SharedState::new in favour of / impls #15

Note: The third issue’s title lost the back-ticked generics during shell quoting. If you’d like the title amended (e.g. “Deprecate SharedState::new in favour of From<Arc> / From<T> impls”), let me know and I’ll update it.

Happy to help—just shout if anything needs tweaking!

(_/)
(•‿•)っ🎫

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant