From b3d4dd59981080f9cc1cbbb15f79700e02ad00c9 Mon Sep 17 00:00:00 2001 From: Andrew Plaza Date: Tue, 9 Apr 2024 16:15:16 -0400 Subject: [PATCH 1/3] fix clippy on generated code --- Dockerfile | 2 +- xmtp_mls/src/groups/subscriptions.rs | 4 ++-- xmtp_proto/src/lib.rs | 9 ++++++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index bbdb7acb3..23a02dd53 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ ENV RUSTUP_PERMIT_COPY_RENAME "yes" RUN cargo check RUN cargo fmt --check -RUN cargo clippy --all-features --no-deps +RUN cargo clippy --all-features --no-deps -Dwarnings # some tests are setup as integration tests 👀 xmtp_mls RUN for crate in xmtp_cryptography xmtp_proto xmtp_v2; do cd ${crate}; cargo test; done diff --git a/xmtp_mls/src/groups/subscriptions.rs b/xmtp_mls/src/groups/subscriptions.rs index 918a24cd0..8ddb9f959 100644 --- a/xmtp_mls/src/groups/subscriptions.rs +++ b/xmtp_mls/src/groups/subscriptions.rs @@ -75,7 +75,7 @@ where client: Arc>, group_id: Vec, created_at_ns: i64, - mut callback: impl FnMut(StoredGroupMessage) + Send + 'static, + callback: impl FnMut(StoredGroupMessage) + Send + 'static, ) -> Result { Ok(Client::::stream_messages_with_callback( client, @@ -86,7 +86,7 @@ where cursor: 0, }, )]), - move |message| callback(message), + callback, )?) } } diff --git a/xmtp_proto/src/lib.rs b/xmtp_proto/src/lib.rs index 4bd33083f..e9ee6727c 100644 --- a/xmtp_proto/src/lib.rs +++ b/xmtp_proto/src/lib.rs @@ -1,3 +1,10 @@ -include!("gen/mod.rs"); +#[allow(clippy::all)] +mod generated { + include!("gen/mod.rs"); +} + +pub use generated::*; + +// pub use gen::*; #[cfg(feature = "xmtp-message_api-v1")] pub mod api_client; From 8cf14b3ec4ab6ff2de29962fe47ef82bc31e0d34 Mon Sep 17 00:00:00 2001 From: Andrew Plaza Date: Tue, 9 Apr 2024 16:22:56 -0400 Subject: [PATCH 2/3] remove random comment --- xmtp_proto/src/lib.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/xmtp_proto/src/lib.rs b/xmtp_proto/src/lib.rs index e9ee6727c..5bdcdbfa3 100644 --- a/xmtp_proto/src/lib.rs +++ b/xmtp_proto/src/lib.rs @@ -2,9 +2,7 @@ mod generated { include!("gen/mod.rs"); } - pub use generated::*; -// pub use gen::*; #[cfg(feature = "xmtp-message_api-v1")] pub mod api_client; From 27ab89995dbfa8c166c44a7ab3085812e2539c93 Mon Sep 17 00:00:00 2001 From: Andrew Plaza Date: Tue, 9 Apr 2024 16:27:34 -0400 Subject: [PATCH 3/3] fix clippy cmd --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 23a02dd53..d492036e7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ ENV RUSTUP_PERMIT_COPY_RENAME "yes" RUN cargo check RUN cargo fmt --check -RUN cargo clippy --all-features --no-deps -Dwarnings +RUN cargo clippy --all-features --no-deps -- -Dwarnings # some tests are setup as integration tests 👀 xmtp_mls RUN for crate in xmtp_cryptography xmtp_proto xmtp_v2; do cd ${crate}; cargo test; done