diff --git a/libsignal-service-hyper/src/push_service.rs b/libsignal-service-hyper/src/push_service.rs index 4a28ae2b6..6a294825e 100644 --- a/libsignal-service-hyper/src/push_service.rs +++ b/libsignal-service-hyper/src/push_service.rs @@ -532,12 +532,15 @@ impl PushService for HyperPushService { } #[tracing::instrument(skip(self, value, file), fields(file = file.as_ref().map(|_| "")))] - async fn post_to_cdn0<'s, C: io::Read + Send + 's>( + async fn post_to_cdn0<'s, C>( &mut self, path: &str, value: &[(&str, &str)], file: Option<(&str, &'s mut C)>, - ) -> Result<(), ServiceError> { + ) -> Result<(), ServiceError> + where + C: io::Read + Send + 's, + { let mut form = mpart_async::client::MultipartRequest::default(); // mpart-async has a peculiar ordering of the form items, diff --git a/libsignal-service/examples/storage.rs b/libsignal-service/examples/storage.rs index bb1786825..e9e7f5df0 100644 --- a/libsignal-service/examples/storage.rs +++ b/libsignal-service/examples/storage.rs @@ -16,6 +16,7 @@ impl ExampleStore { } #[async_trait::async_trait(?Send)] +#[allow(clippy::diverging_sub_expression)] impl PreKeyStore for ExampleStore { /// Look up the pre-key corresponding to `prekey_id`. async fn get_pre_key( @@ -44,6 +45,7 @@ impl PreKeyStore for ExampleStore { } #[async_trait::async_trait(?Send)] +#[allow(clippy::diverging_sub_expression)] impl KyberPreKeyStore for ExampleStore { /// Look up the signed kyber pre-key corresponding to `kyber_prekey_id`. async fn get_kyber_pre_key( @@ -73,6 +75,7 @@ impl KyberPreKeyStore for ExampleStore { } #[async_trait::async_trait(?Send)] +#[allow(clippy::diverging_sub_expression)] impl SignedPreKeyStore for ExampleStore { /// Look up the signed pre-key corresponding to `signed_prekey_id`. async fn get_signed_pre_key( @@ -93,6 +96,7 @@ impl SignedPreKeyStore for ExampleStore { } #[async_trait::async_trait(?Send)] +#[allow(clippy::diverging_sub_expression)] impl KyberPreKeyStoreExt for ExampleStore { async fn store_last_resort_kyber_pre_key( &mut self, @@ -134,6 +138,7 @@ impl KyberPreKeyStoreExt for ExampleStore { } #[async_trait::async_trait(?Send)] +#[allow(clippy::diverging_sub_expression)] impl IdentityKeyStore for ExampleStore { /// Return the single specific identity the store is assumed to represent, with private key. async fn get_identity_key_pair( @@ -189,6 +194,7 @@ impl IdentityKeyStore for ExampleStore { } #[async_trait::async_trait(?Send)] +#[allow(clippy::diverging_sub_expression)] impl PreKeysStore for ExampleStore { /// ID of the next pre key async fn next_pre_key_id(&self) -> Result { diff --git a/libsignal-service/src/messagepipe.rs b/libsignal-service/src/messagepipe.rs index cd6e0506a..9da098599 100644 --- a/libsignal-service/src/messagepipe.rs +++ b/libsignal-service/src/messagepipe.rs @@ -138,12 +138,13 @@ impl MessagePipe { /// WebSocketService that panics on every request, mainly for example code. pub struct PanicingWebSocketService; +#[allow(clippy::diverging_sub_expression)] #[cfg_attr(feature = "unsend-futures", async_trait::async_trait(?Send))] #[cfg_attr(not(feature = "unsend-futures"), async_trait::async_trait)] impl WebSocketService for PanicingWebSocketService { type Stream = futures::channel::mpsc::Receiver; async fn send_message(&mut self, _msg: Bytes) -> Result<(), ServiceError> { - unimplemented!(); + todo!(); } } diff --git a/libsignal-service/src/push_service.rs b/libsignal-service/src/push_service.rs index 7bdec5912..4724ce81f 100644 --- a/libsignal-service/src/push_service.rs +++ b/libsignal-service/src/push_service.rs @@ -700,12 +700,14 @@ pub trait PushService: MaybeSend { /// Upload larger file to CDN0 in legacy fashion, e.g. for attachments. /// /// Implementations are allowed to *panic* when the Read instance throws an IO-Error - async fn post_to_cdn0<'s, C: std::io::Read + Send + 's>( + async fn post_to_cdn0<'s, C>( &mut self, path: &str, value: &[(&str, &str)], file: Option<(&str, &'s mut C)>, - ) -> Result<(), ServiceError>; + ) -> Result<(), ServiceError> + where + C: std::io::Read + Send + 's; async fn ws( &mut self, @@ -851,11 +853,14 @@ pub trait PushService: MaybeSend { /// Upload attachment to CDN /// /// Returns attachment ID and the attachment digest - async fn upload_attachment<'s, C: std::io::Read + Send + 's>( + async fn upload_attachment<'s, C>( &mut self, attrs: &AttachmentV2UploadAttributes, content: &'s mut C, - ) -> Result<(u64, Vec), ServiceError> { + ) -> Result<(u64, Vec), ServiceError> + where + C: std::io::Read + Send + 's, + { let values = [ ("acl", &attrs.acl as &str), ("key", &attrs.key), @@ -1081,7 +1086,7 @@ pub trait PushService: MaybeSend { /// See [`AccountManager`][struct@crate::AccountManager] for a convenience method. /// /// Java equivalent: `writeProfile` - async fn write_profile<'s, C: std::io::Read + Send + 's, S: AsRef>( + async fn write_profile<'s, C, S>( &mut self, version: &ProfileKeyVersion, name: &[u8], @@ -1089,7 +1094,11 @@ pub trait PushService: MaybeSend { emoji: &[u8], commitment: &ProfileKeyCommitment, avatar: AvatarWrite<&mut C>, - ) -> Result, ServiceError> { + ) -> Result, ServiceError> + where + C: std::io::Read + Send + 's, + S: AsRef, + { #[derive(Debug, Serialize)] #[serde(rename_all = "camelCase")] struct SignalServiceProfileWrite<'s> {