Skip to content

Fix readiness signal handling: is_some_and borrows but send() requires ownership #311

@coderabbitai

Description

@coderabbitai

Problem

In src/server/runtime.rs around lines 220-223, the current readiness signalling code will not compile:

if ready_tx.is_some_and(|tx| tx.send(()).is_err()) {
    tracing::warn!("Failed to send readiness signal: receiver dropped");
}

Issue: Option::is_some_and passes &Sender to the closure, but oneshot::Sender::send takes self by value.

Solution

Replace with a match that moves the sender:

match ready_tx {
    Some(tx) => {
        if tx.send(()).is_err() {
            tracing::warn!("Failed to send readiness signal: receiver dropped");
        }
    }
    None => {}
}

References

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions