Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cot/src/middleware/live_reload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ mod tests {
test_live_reload_from_context(false).await;
}

#[expect(clippy::future_not_send, reason = "test function using Bootstrapper")]
async fn test_live_reload_from_context(enabled: bool) {
struct TestProject;
impl Project for TestProject {}
Expand Down
28 changes: 5 additions & 23 deletions cot/src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ pub trait App: Send + Sync {
/// MyProject
/// }
/// ```
pub trait Project {
pub trait Project: Send {
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

Project is a public trait and adding : Send is a breaking API change for downstream implementors that were using Rc/RefCell or other !Send state. This repo’s CHANGELOG follows SemVer/Keep-a-Changelog and typically labels breaking changes; please add an entry under [Unreleased] marking this as breaking (and ensure the release/versioning process accounts for it).

Suggested change
pub trait Project: Send {
pub trait Project {

Copilot uses AI. Check for mistakes.
/// Returns the metadata for the CLI.
///
/// This method is used to set the name, version, authors, and description
Expand Down Expand Up @@ -1085,8 +1085,6 @@ impl Bootstrapper<WithConfig> {
/// # Ok(())
/// # }
/// ```
// Send not needed; Bootstrapper is run async in a single thread
#[expect(clippy::future_not_send)]
pub async fn boot(self) -> cot::Result<Bootstrapper<Initialized>> {
self.with_apps().boot().await
}
Expand Down Expand Up @@ -1171,8 +1169,6 @@ impl Bootstrapper<WithApps> {
/// # Ok(())
/// # }
/// ```
// Send not needed; Bootstrapper is run async in a single thread
#[expect(clippy::future_not_send)]
pub async fn boot(self) -> cot::Result<Bootstrapper<Initialized>> {
self.with_database().await?.boot().await
}
Expand Down Expand Up @@ -1209,8 +1205,6 @@ impl Bootstrapper<WithApps> {
/// # Ok(())
/// # }
/// ```
// Send not needed; Bootstrapper is run async in a single thread
#[expect(clippy::future_not_send)]
pub async fn with_database(self) -> cot::Result<Bootstrapper<WithDatabase>> {
#[cfg(feature = "db")]
let database = Self::init_database(&self.context.config.database).await?;
Expand Down Expand Up @@ -1275,8 +1269,6 @@ impl Bootstrapper<WithDatabase> {
/// # }
/// ```
// Function marked `async` to be consistent with the other `boot` methods
// Send not needed; Bootstrapper is run async in a single thread
#[expect(clippy::future_not_send)]
pub async fn boot(self) -> cot::Result<Bootstrapper<Initialized>> {
self.with_cache().await?.boot().await
}
Expand Down Expand Up @@ -1314,7 +1306,6 @@ impl Bootstrapper<WithDatabase> {
/// # Ok(())
/// # }
/// ```
#[expect(clippy::future_not_send)]
#[allow(
clippy::unused_async,
clippy::allow_attributes,
Expand Down Expand Up @@ -1379,7 +1370,10 @@ impl Bootstrapper<WithCache> {
/// # Ok(())
/// # }
/// ```
#[expect(clippy::unused_async, clippy::future_not_send)]
#[expect(
clippy::unused_async,
reason = "for consistency with other Bootstrapper::boot methods"
)]
pub async fn boot(self) -> cot::Result<Bootstrapper<Initialized>> {
let router_service = RouterService::new(Arc::clone(&self.context.router));
let handler_builder = RootHandlerBuilder {
Expand Down Expand Up @@ -2057,10 +2051,6 @@ impl<S: BootstrapPhase<Database = Option<Database>>> ProjectContext<S> {
/// # Errors
///
/// This function returns an error if the server fails to start.
#[expect(
clippy::future_not_send,
reason = "Send not needed; Bootstrapper/CLI is run async in a single thread"
)]
pub async fn run(bootstrapper: Bootstrapper<Initialized>, address_str: &str) -> cot::Result<()> {
let listener = tokio::net::TcpListener::bind(address_str)
.await
Expand All @@ -2082,10 +2072,6 @@ pub async fn run(bootstrapper: Bootstrapper<Initialized>, address_str: &str) ->
/// # Errors
///
/// This function returns an error if the server fails to start.
#[expect(
clippy::future_not_send,
reason = "Send not needed; Bootstrapper/CLI is run async in a single thread"
)]
pub async fn run_at(
bootstrapper: Bootstrapper<Initialized>,
listener: tokio::net::TcpListener,
Expand All @@ -2106,10 +2092,6 @@ pub async fn run_at(
/// # Errors
///
/// This function returns an error if the server fails to start.
#[expect(
clippy::future_not_send,
reason = "Send not needed; Bootstrapper/CLI is run async in a single thread"
)]
pub async fn run_at_with_shutdown(
bootstrapper: Bootstrapper<Initialized>,
listener: tokio::net::TcpListener,
Expand Down
1 change: 0 additions & 1 deletion cot/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ impl Client {
/// }
/// ```
#[must_use]
#[expect(clippy::future_not_send)] // used in the test code
pub async fn new<P>(project: P) -> Self
where
P: Project + 'static,
Expand Down
Loading