From 3a97ede562c7a8191e8b2fdf0e7a0685496790a6 Mon Sep 17 00:00:00 2001 From: "Ericson \"Fogo\" Soares" Date: Fri, 27 Sep 2024 00:38:48 -0300 Subject: [PATCH] Update toolchain and fix a bunch of warnings --- Cargo.lock | Bin 337906 -> 337706 bytes core/Cargo.toml | 1 - core/crates/cloud-services/src/client.rs | 12 +- .../src/key_manager/key_store.rs | 2 +- core/crates/cloud-services/src/sync/ingest.rs | 2 +- .../heavy-lifting/src/job_system/report.rs | 2 +- core/src/library/statistics.rs | 2 +- core/src/location/manager/watcher/mod.rs | 2 + crates/actors/src/lib.rs | 6 +- crates/cloud-api/Cargo.toml | 21 - crates/cloud-api/src/auth.rs | 17 - crates/cloud-api/src/lib.rs | 636 ------------------ crates/p2p/crates/tunnel/src/lib.rs | 2 +- crates/task-system/src/task.rs | 6 +- rust-toolchain.toml | 2 +- 15 files changed, 22 insertions(+), 691 deletions(-) delete mode 100644 crates/cloud-api/Cargo.toml delete mode 100644 crates/cloud-api/src/auth.rs delete mode 100644 crates/cloud-api/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index e68b5755859f9b4ca3f837e3a2ee416845e1b96c..a6fe702d8278bf9a8209de7b6e5e7ee86af72b67 100644 GIT binary patch delta 36 scmex#US!odk%kt=7N#xCS?${uJD5#art?l`=4&tMVcuTS!%{aJ01z_`+5i9m delta 88 zcmV-e0H^<|&J^;`6o7;QgaWh!YKH@1aA}tjp93eCa)tvH4s&p0A}k6ZB6DOda58Y0 uA$|iNmk*Q!3YWm20~nY4n*#}#zo`Qlw_=9_JOlz^aEFhJ1GkTh1e=>|^B-0K diff --git a/core/Cargo.toml b/core/Cargo.toml index 224f8d6bf..6ed9d6eea 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -30,7 +30,6 @@ sd-core-sync = { path = "./crates/sync" } # Spacedrive Sub-crates sd-actors = { path = "../crates/actors" } sd-ai = { path = "../crates/ai", optional = true } -sd-cloud-api = { path = "../crates/cloud-api" } sd-crypto = { path = "../crates/crypto" } sd-ffmpeg = { path = "../crates/ffmpeg", optional = true } sd-file-ext = { path = "../crates/file-ext" } diff --git a/core/crates/cloud-services/src/client.rs b/core/crates/cloud-services/src/client.rs index b067aa0ee..cfb66784c 100644 --- a/core/crates/cloud-services/src/client.rs +++ b/core/crates/cloud-services/src/client.rs @@ -18,7 +18,7 @@ use super::{ error::Error, key_manager::KeyManager, p2p::CloudP2P, token_refresher::TokenRefresher, }; -#[derive(Debug, Default)] +#[derive(Debug, Default, Clone)] enum ClientState { #[default] NotConnected, @@ -190,7 +190,8 @@ impl CloudServices { _message: &[u8], _cert: &rustls::pki_types::CertificateDer<'_>, _dss: &rustls::DigitallySignedStruct, - ) -> Result { + ) -> Result + { Ok(rustls::client::danger::HandshakeSignatureValid::assertion()) } @@ -199,7 +200,8 @@ impl CloudServices { _message: &[u8], _cert: &rustls::pki_types::CertificateDer<'_>, _dss: &rustls::DigitallySignedStruct, - ) -> Result { + ) -> Result + { Ok(rustls::client::danger::HandshakeSignatureValid::assertion()) } @@ -268,8 +270,8 @@ impl CloudServices { /// Available routes documented in /// [`sd_cloud_schema::Service`](https://github.com/spacedriveapp/cloud-services-schema). pub async fn client(&self) -> Result, Service>, Error> { - if let ClientState::Connected(client) = &*self.client_state.read().await { - return Ok(client.clone()); + if let ClientState::Connected(client) = { self.client_state.read().await.clone() } { + return Ok(client); } // If we're not connected, we need to try to connect. diff --git a/core/crates/cloud-services/src/key_manager/key_store.rs b/core/crates/cloud-services/src/key_manager/key_store.rs index 087eff70b..922597a73 100644 --- a/core/crates/cloud-services/src/key_manager/key_store.rs +++ b/core/crates/cloud-services/src/key_manager/key_store.rs @@ -33,7 +33,7 @@ pub struct KeyStore { } impl KeyStore { - pub fn new(iroh_secret_key: IrohSecretKey) -> Self { + pub const fn new(iroh_secret_key: IrohSecretKey) -> Self { Self { iroh_secret_key, keys: BTreeMap::new(), diff --git a/core/crates/cloud-services/src/sync/ingest.rs b/core/crates/cloud-services/src/sync/ingest.rs index 07be4f76a..cabede505 100644 --- a/core/crates/cloud-services/src/sync/ingest.rs +++ b/core/crates/cloud-services/src/sync/ingest.rs @@ -82,7 +82,7 @@ enum IngestStatus { } impl Ingester { - pub fn new( + pub const fn new( sync: SyncManager, ingest_notify: Arc, active: Arc, diff --git a/core/crates/heavy-lifting/src/job_system/report.rs b/core/crates/heavy-lifting/src/job_system/report.rs index 359bc4496..d0e5f0108 100644 --- a/core/crates/heavy-lifting/src/job_system/report.rs +++ b/core/crates/heavy-lifting/src/job_system/report.rs @@ -402,7 +402,7 @@ impl ReportBuilder { } #[must_use] - pub fn new(id: JobId, name: JobName) -> Self { + pub const fn new(id: JobId, name: JobName) -> Self { Self { id, name, diff --git a/core/src/library/statistics.rs b/core/src/library/statistics.rs index e8c757eba..f6fc4422e 100644 --- a/core/src/library/statistics.rs +++ b/core/src/library/statistics.rs @@ -47,7 +47,7 @@ pub async fn update_library_statistics( node.config .data_directory() .join("libraries") - .join(&format!("{}.db", library.id)), + .join(format!("{}.db", library.id)), ) .await .unwrap_or(0); diff --git a/core/src/location/manager/watcher/mod.rs b/core/src/location/manager/watcher/mod.rs index 48935f4d3..81b70ef87 100644 --- a/core/src/location/manager/watcher/mod.rs +++ b/core/src/location/manager/watcher/mod.rs @@ -67,6 +67,8 @@ type Handler = ios::EventHandler; pub(super) type IgnorePath = (PathBuf, bool); type INode = u64; + +#[cfg(any(target_os = "ios", target_os = "macos", target_os = "windows"))] type InstantAndPath = (Instant, PathBuf); const ONE_SECOND: Duration = Duration::from_secs(1); diff --git a/crates/actors/src/lib.rs b/crates/actors/src/lib.rs index 1666c974d..0eaa0724c 100644 --- a/crates/actors/src/lib.rs +++ b/crates/actors/src/lib.rs @@ -169,7 +169,8 @@ impl ActorsCollection { #[instrument(skip(self))] pub async fn start(&self, identifier: Id) { - if let Some(actor) = self.actors_map.write().await.get_mut(&identifier) { + let mut actors_map = self.actors_map.write().await; + if let Some(actor) = actors_map.get_mut(&identifier) { if actor.is_running.load(Ordering::Acquire) { warn!("Actor already running!"); return; @@ -223,7 +224,8 @@ impl ActorsCollection { #[instrument(skip(self))] pub async fn stop(&self, identifier: Id) { - if let Some(actor) = self.actors_map.write().await.get_mut(&identifier) { + let mut actors_map = self.actors_map.write().await; + if let Some(actor) = actors_map.get_mut(&identifier) { if !actor.is_running.load(Ordering::Acquire) { warn!("Actor already stopped!"); return; diff --git a/crates/cloud-api/Cargo.toml b/crates/cloud-api/Cargo.toml deleted file mode 100644 index 491b2fe7c..000000000 --- a/crates/cloud-api/Cargo.toml +++ /dev/null @@ -1,21 +0,0 @@ -[package] -name = "sd-cloud-api" -version = "0.1.0" - -edition.workspace = true -license.workspace = true -repository.workspace = true - -[dependencies] -# Spacedrive Sub-crates -sd-p2p = { path = "../p2p" } - -# Workspace dependencies -reqwest = { workspace = true, features = ["native-tls-vendored"] } -rspc = { workspace = true } -serde = { workspace = true } -serde_json = { workspace = true } -specta = { workspace = true } -thiserror = { workspace = true } -tracing = { workspace = true } -uuid = { workspace = true } diff --git a/crates/cloud-api/src/auth.rs b/crates/cloud-api/src/auth.rs deleted file mode 100644 index f8d879641..000000000 --- a/crates/cloud-api/src/auth.rs +++ /dev/null @@ -1,17 +0,0 @@ -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Debug, Serialize, Deserialize)] -pub struct OAuthToken { - pub access_token: String, - pub refresh_token: String, - pub token_type: String, - pub expires_in: i32, -} - -impl OAuthToken { - pub fn to_header(&self) -> String { - format!("{} {}", self.token_type, self.access_token) - } -} - -pub const DEVICE_CODE_URN: &str = "urn:ietf:params:oauth:grant-type:device_code"; diff --git a/crates/cloud-api/src/lib.rs b/crates/cloud-api/src/lib.rs deleted file mode 100644 index 6880f4ab6..000000000 --- a/crates/cloud-api/src/lib.rs +++ /dev/null @@ -1,636 +0,0 @@ -pub mod auth; - -use std::{collections::HashMap, future::Future, sync::Arc}; - -use auth::OAuthToken; -use sd_p2p::RemoteIdentity; -use serde::{Deserialize, Serialize}; -use serde_json::json; -use specta::Type; -use uuid::Uuid; - -pub struct RequestConfig { - pub client: reqwest::Client, - pub api_url: String, - pub auth_token: Option, -} - -pub trait RequestConfigProvider { - fn get_request_config(self: &Arc) -> impl Future + Send; -} - -#[derive(thiserror::Error, Debug)] -#[error("{0}")] -pub struct Error(String); - -impl From for rspc::Error { - fn from(e: Error) -> rspc::Error { - rspc::Error::new(rspc::ErrorCode::InternalServerError, e.0) - } -} - -#[derive(Serialize, Deserialize, Debug, Type)] -#[serde(rename_all = "camelCase")] -#[specta(rename = "CloudLibrary")] -pub struct Library { - pub id: String, - pub uuid: Uuid, - pub name: String, - pub instances: Vec, - pub owner_id: String, -} - -#[derive(Serialize, Deserialize, Debug, Type)] -#[serde(rename_all = "camelCase")] -#[specta(rename = "CloudInstance")] -pub struct Instance { - pub id: String, - pub uuid: Uuid, - pub identity: RemoteIdentity, - #[serde(rename = "nodeId")] - pub node_id: Uuid, - pub node_remote_identity: String, - pub metadata: HashMap, -} - -#[derive(Serialize, Deserialize, Debug, Type)] -#[serde(rename_all = "camelCase")] -#[specta(rename = "CloudMessageCollection")] -pub struct MessageCollection { - pub instance_uuid: Uuid, - pub start_time: String, - pub end_time: String, - pub contents: String, -} - -trait WithAuth { - fn with_auth(self, token: OAuthToken) -> Self; -} - -impl WithAuth for reqwest::RequestBuilder { - fn with_auth(self, token: OAuthToken) -> Self { - self.header( - "authorization", - format!("{} {}", token.token_type, token.access_token), - ) - } -} - -pub mod feedback { - use super::*; - - pub use send::exec as send; - pub mod send { - use super::*; - - pub async fn exec(config: RequestConfig, message: String, emoji: u8) -> Result<(), Error> { - let mut req = config - .client - .post(format!("{}/api/v1/feedback", config.api_url)) - .json(&json!({ - "message": message, - "emoji": emoji, - })); - - if let Some(auth_token) = config.auth_token { - req = req.with_auth(auth_token); - } - - req.send() - .await - .and_then(|r| r.error_for_status()) - .map_err(|e| Error(e.to_string()))?; - - Ok(()) - } - } -} - -pub mod user { - use super::*; - - pub use me::exec as me; - pub mod me { - use super::*; - - #[derive(Serialize, Deserialize, Type)] - #[specta(inline)] - pub struct Response { - id: String, - email: String, - } - - pub async fn exec(config: RequestConfig) -> Result { - let Some(auth_token) = config.auth_token else { - return Err(Error("Authentication required".to_string())); - }; - - config - .client - .get(&format!("{}/api/v1/user/me", config.api_url)) - .with_auth(auth_token) - .send() - .await - .map_err(|e| Error(e.to_string()))? - .json() - .await - .map_err(|e| Error(e.to_string())) - } - } -} - -pub mod library { - use super::*; - - pub use get::exec as get; - pub mod get { - use super::*; - - pub async fn exec(config: RequestConfig, library_id: Uuid) -> Result { - let Some(auth_token) = config.auth_token else { - return Err(Error("Authentication required".to_string())); - }; - - config - .client - .get(&format!( - "{}/api/v1/libraries/{}", - config.api_url, library_id - )) - .with_auth(auth_token) - .send() - .await - .map_err(|e| Error(e.to_string()))? - .json() - .await - .map_err(|e| Error(e.to_string())) - } - - pub type Response = Option; - } - - pub use list::exec as list; - pub mod list { - use super::*; - - pub async fn exec(config: RequestConfig) -> Result { - let Some(auth_token) = config.auth_token else { - return Err(Error("Authentication required".to_string())); - }; - - config - .client - .get(&format!("{}/api/v1/libraries", config.api_url)) - .with_auth(auth_token) - .send() - .await - .map_err(|e| Error(e.to_string()))? - .json() - .await - .map_err(|e| Error(e.to_string())) - } - - pub type Response = Vec; - } - - pub use create::exec as create; - pub mod create { - use super::*; - - #[derive(Debug, Deserialize)] - pub struct CreateResult { - pub id: String, - } - - #[allow(clippy::too_many_arguments)] - pub async fn exec( - config: RequestConfig, - library_id: Uuid, - name: &str, - instance_uuid: Uuid, - instance_identity: RemoteIdentity, - node_id: Uuid, - node_remote_identity: RemoteIdentity, - metadata: &HashMap, - ) -> Result { - let Some(auth_token) = config.auth_token else { - return Err(Error("Authentication required".to_string())); - }; - - config - .client - .post(&format!( - "{}/api/v1/libraries/{}", - config.api_url, library_id - )) - .json(&json!({ - "name":name, - "instanceUuid": instance_uuid, - "instanceIdentity": instance_identity, - "nodeId": node_id, - "nodeRemoteIdentity": node_remote_identity, - "metadata": metadata, - })) - .with_auth(auth_token) - .send() - .await - .map_err(|e| Error(e.to_string()))? - .json() - .await - .map_err(|e| Error(e.to_string())) - } - } - - pub use update::exec as update; - pub mod update { - use super::*; - - pub async fn exec( - config: RequestConfig, - library_id: Uuid, - name: Option, - ) -> Result<(), Error> { - let Some(auth_token) = config.auth_token else { - return Err(Error("Authentication required".to_string())); - }; - - config - .client - .patch(&format!( - "{}/api/v1/libraries/{}", - config.api_url, library_id - )) - .json(&json!({ - "name":name - })) - .with_auth(auth_token) - .send() - .await - .map_err(|e| Error(e.to_string())) - .map(|_| ()) - } - } - - pub use update_instance::exec as update_instance; - pub mod update_instance { - use super::*; - - pub async fn exec( - config: RequestConfig, - library_id: Uuid, - instance_id: Uuid, - node_id: Option, - node_remote_identity: Option, - metadata: Option>, - ) -> Result<(), Error> { - let Some(auth_token) = config.auth_token else { - return Err(Error("Authentication required".to_string())); - }; - - config - .client - .patch(&format!( - "{}/api/v1/libraries/{}/{}", - config.api_url, library_id, instance_id - )) - .json(&json!({ - "nodeId": node_id, - "nodeRemoteIdentity": node_remote_identity, - "metadata": metadata, - })) - .with_auth(auth_token) - .send() - .await - .map_err(|e| Error(e.to_string())) - .map(|_| ()) - } - } - - pub use join::exec as join; - pub mod join { - use super::*; - - pub async fn exec( - config: RequestConfig, - library_id: Uuid, - instance_uuid: Uuid, - instance_identity: RemoteIdentity, - node_id: Uuid, - node_remote_identity: RemoteIdentity, - metadata: HashMap, - ) -> Result, Error> { - let Some(auth_token) = config.auth_token else { - return Err(Error("Authentication required".to_string())); - }; - - config - .client - .post(&format!( - "{}/api/v1/libraries/{library_id}/instances/{instance_uuid}", - config.api_url - )) - .json(&json!({ - "instanceIdentity": instance_identity, - "nodeId": node_id, - "nodeRemoteIdentity": node_remote_identity, - "metadata": metadata, - })) - .with_auth(auth_token) - .send() - .await - .map_err(|e| Error(e.to_string()))? - .json() - .await - .map_err(|e| Error(e.to_string())) - } - } - - pub mod message_collections { - use super::*; - - pub use get::exec as get; - pub mod get { - use super::*; - use tracing::debug; - - #[derive(Serialize)] - #[serde(rename_all = "camelCase")] - pub struct InstanceTimestamp { - pub instance_uuid: Uuid, - pub from_time: String, - } - - pub async fn exec( - config: RequestConfig, - library_id: Uuid, - this_instance_uuid: Uuid, - timestamps: Vec, - ) -> Result { - let Some(auth_token) = config.auth_token else { - return Err(Error("Authentication required".to_string())); - }; - - let res = config - .client - .post(&format!( - "{}/api/v1/libraries/{}/messageCollections/get", - config.api_url, library_id - )) - .json(&json!({ - "instanceUuid": this_instance_uuid, - "timestamps": timestamps - })) - .with_auth(auth_token) - .send() - .await; - - debug!("get message collections response: {:?}", res); - - match res { - Ok(response) => { - let status = response.status(); - let body = response.text().await.map_err(|e| Error(e.to_string()))?; - debug!("Response status: {}", status); - debug!("Response body: {}", body); - - // Attempt to parse the body as JSON - match serde_json::from_str::(&body) { - Ok(json) => Ok(json), - Err(e) => Err(Error(format!( - "error decoding response body: {}. Body: {}", - e, body - ))), - } - } - Err(e) => Err(Error(e.to_string())), - } - } - - pub type Response = Vec; - } - - pub use request_add::exec as request_add; - pub mod request_add { - use super::*; - use tracing::debug; - - #[derive(Deserialize, Debug)] - #[serde(rename_all = "camelCase")] - pub struct RequestAdd { - pub instance_uuid: Uuid, - pub from_time: Option, - // mutex key on the instance - pub key: String, - } - - pub async fn exec( - config: RequestConfig, - library_id: Uuid, - instances: Vec, - ) -> Result { - let Some(auth_token) = config.auth_token else { - return Err(Error("Authentication required".to_string())); - }; - - let instances = instances - .into_iter() - .map(|i| json!({"instanceUuid": i })) - .collect::>(); - - let res = config - .client - .post(&format!( - "{}/api/v1/libraries/{}/messageCollections/requestAdd", - config.api_url, library_id - )) - .json(&json!({ "instances": instances })) - .with_auth(auth_token) - .send() - .await; - - debug!("request add response: {:?}", res); - - match res { - Ok(response) => { - let status = response.status(); - let body = response.text().await.map_err(|e| Error(e.to_string()))?; - debug!("Response status: {}", status); - debug!("Response body: {}", body); - - // Attempt to parse the body as JSON - match serde_json::from_str::(&body) { - Ok(json) => Ok(json), - Err(e) => Err(Error(format!( - "error decoding response body: {}. Body: {}", - e, body - ))), - } - } - Err(e) => Err(Error(e.to_string())), - } - } - - pub type Response = Vec; - } - - pub use do_add::exec as do_add; - pub mod do_add { - use super::*; - - #[derive(Serialize, Debug)] - #[serde(rename_all = "camelCase")] - pub struct Input { - pub uuid: Uuid, - pub key: String, - pub start_time: String, - pub end_time: String, - pub contents: String, - pub ops_count: usize, - } - - pub async fn exec( - config: RequestConfig, - library_id: Uuid, - instances: Vec, - ) -> Result<(), Error> { - let Some(auth_token) = config.auth_token else { - return Err(Error("Authentication required".to_string())); - }; - - config - .client - .post(&format!( - "{}/api/v1/libraries/{}/messageCollections/doAdd", - config.api_url, library_id - )) - .json(&json!({ "instances": instances })) - .with_auth(auth_token) - .send() - .await - .and_then(|r| r.error_for_status()) - .map_err(|e| Error(e.to_string()))?; - - Ok(()) - } - } - } -} - -#[derive(Type, Serialize, Deserialize)] -#[specta(rename = "Core_CloudLocation")] -pub struct CloudLocation { - id: String, - name: String, -} - -pub mod locations { - use super::*; - - pub use list::exec as list; - pub mod list { - use super::*; - - pub async fn exec(config: RequestConfig) -> Result { - let Some(auth_token) = config.auth_token else { - return Err(Error("Authentication required".to_string())); - }; - - config - .client - .get(&format!("{}/api/v1/locations", config.api_url)) - .with_auth(auth_token) - .send() - .await - .map_err(|e| Error(e.to_string()))? - .json() - .await - .map_err(|e| Error(e.to_string())) - } - - pub type Response = Vec; - } - - pub use create::exec as create; - pub mod create { - use super::*; - - pub async fn exec(config: RequestConfig, name: String) -> Result { - let Some(auth_token) = config.auth_token else { - return Err(Error("Authentication required".to_string())); - }; - - config - .client - .post(&format!("{}/api/v1/locations", config.api_url)) - .json(&json!({ - "name": name, - })) - .with_auth(auth_token) - .send() - .await - .map_err(|e| Error(e.to_string()))? - .json() - .await - .map_err(|e| Error(e.to_string())) - } - - pub type Response = CloudLocation; - } - - pub use remove::exec as remove; - pub mod remove { - use super::*; - - pub async fn exec(config: RequestConfig, id: String) -> Result { - let Some(auth_token) = config.auth_token else { - return Err(Error("Authentication required".to_string())); - }; - - config - .client - .post(&format!("{}/api/v1/locations/delete", config.api_url)) - .json(&json!({ - "id": id, - })) - .with_auth(auth_token) - .send() - .await - .map_err(|e| Error(e.to_string()))? - .json() - .await - .map_err(|e| Error(e.to_string())) - } - - pub type Response = CloudLocation; - } - - pub use authorize::exec as authorize; - pub mod authorize { - use super::*; - - pub async fn exec(config: RequestConfig, id: String) -> Result { - let Some(auth_token) = config.auth_token else { - return Err(Error("Authentication required".to_string())); - }; - - config - .client - .post(&format!("{}/api/v1/locations/authorize", config.api_url)) - .json(&json!({ "id": id })) - .with_auth(auth_token) - .send() - .await - .map_err(|e| Error(e.to_string()))? - .json() - .await - .map_err(|e| Error(e.to_string())) - } - - #[derive(Debug, Clone, Type, Deserialize)] - pub struct Response { - pub access_key_id: String, - pub secret_access_key: String, - pub session_token: String, - } - } -} diff --git a/crates/p2p/crates/tunnel/src/lib.rs b/crates/p2p/crates/tunnel/src/lib.rs index df7706255..482c736c7 100644 --- a/crates/p2p/crates/tunnel/src/lib.rs +++ b/crates/p2p/crates/tunnel/src/lib.rs @@ -52,7 +52,7 @@ impl Tunnel { library_identity: &Identity, ) -> Result { stream - .write_all(&[b'T']) + .write_all(b"T") .await .map_err(|_| TunnelError::DiscriminatorWriteError)?; diff --git a/crates/task-system/src/task.rs b/crates/task-system/src/task.rs index 8b0ed2956..1b345e812 100644 --- a/crates/task-system/src/task.rs +++ b/crates/task-system/src/task.rs @@ -258,7 +258,7 @@ impl Drop for Interrupter { } impl Interrupter { - pub(crate) fn new(interrupt_tx: chan::Receiver) -> Self { + pub(crate) const fn new(interrupt_tx: chan::Receiver) -> Self { Self { interrupt_rx: interrupt_tx, } @@ -659,7 +659,7 @@ pub struct TaskWorktable { } impl TaskWorktable { - pub fn new(worker_id: WorkerId, interrupt_tx: chan::Sender) -> Self { + pub const fn new(worker_id: WorkerId, interrupt_tx: chan::Sender) -> Self { Self { started: AtomicBool::new(false), is_running: AtomicBool::new(false), @@ -899,7 +899,7 @@ pub struct PanicOnSenderDrop { } impl PanicOnSenderDrop { - pub fn new( + pub const fn new( task_id: TaskId, done_tx: oneshot::Sender, SystemError>>, ) -> Self { diff --git a/rust-toolchain.toml b/rust-toolchain.toml index a56a283d2..1de01fa45 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.80.1" +channel = "1.81.0"