Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix clippy 1.81 #323

Merged
merged 3 commits into from
Sep 30, 2024
Merged
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
7 changes: 5 additions & 2 deletions libsignal-service-hyper/src/push_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions libsignal-service/examples/storage.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::diverging_sub_expression)]

boxdot marked this conversation as resolved.
Show resolved Hide resolved
use libsignal_service::pre_keys::{KyberPreKeyStoreExt, PreKeysStore};
use libsignal_service::protocol::{
Direction, IdentityKey, IdentityKeyPair, IdentityKeyStore, KyberPreKeyId,
Expand Down
1 change: 1 addition & 0 deletions libsignal-service/src/messagepipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ impl MessagePipe {
/// WebSocketService that panics on every request, mainly for example code.
pub struct PanicingWebSocketService;

#[allow(clippy::diverging_sub_expression)]
boxdot marked this conversation as resolved.
Show resolved Hide resolved
#[cfg_attr(feature = "unsend-futures", async_trait::async_trait(?Send))]
#[cfg_attr(not(feature = "unsend-futures"), async_trait::async_trait)]
impl WebSocketService for PanicingWebSocketService {
Expand Down
21 changes: 15 additions & 6 deletions libsignal-service/src/push_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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<u8>), ServiceError> {
) -> Result<(u64, Vec<u8>), ServiceError>
where
C: std::io::Read + Send + 's,
{
let values = [
("acl", &attrs.acl as &str),
("key", &attrs.key),
Expand Down Expand Up @@ -1081,15 +1086,19 @@ 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<str>>(
async fn write_profile<'s, C, S>(
&mut self,
version: &ProfileKeyVersion,
name: &[u8],
about: &[u8],
emoji: &[u8],
commitment: &ProfileKeyCommitment,
avatar: AvatarWrite<&mut C>,
) -> Result<Option<String>, ServiceError> {
) -> Result<Option<String>, ServiceError>
where
C: std::io::Read + Send + 's,
S: AsRef<str>,
{
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
struct SignalServiceProfileWrite<'s> {
Expand Down
Loading