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

Fix some new Clippy lints #306

Merged
merged 2 commits into from
Jul 8, 2024
Merged

Fix some new Clippy lints #306

merged 2 commits into from
Jul 8, 2024

Conversation

rubdos
Copy link
Member

@rubdos rubdos commented Jul 5, 2024

Not entirely sure about this (cca447a):

commit cca447a69d9a5cb1b86714dc1d88856e96b5d9cd
Author: Ruben De Smet <[email protected]>
Date:   Fri Jul 5 16:05:16 2024 +0200

    Fix fallback to never type clippy warning

diff --git a/libsignal-service/src/account_manager.rs b/libsignal-service/src/account_manager.rs
index 14c6242c2..0ca2abad9 100644
--- a/libsignal-service/src/account_manager.rs
+++ b/libsignal-service/src/account_manager.rs
@@ -580,7 +580,7 @@ impl<Service: PushService> AccountManager<Service> {
         }
 
         self.service
-            .put_json(
+            .put_json::<(), _>(
                 Endpoint::Service,
                 "/v1/accounts/name",
                 &[],

The return value is inferred by Rust Analyzer to be !, but that's obviously skipping over the happy-path. I'm 99% sure that the type system infers the Ok-type to be () in Rust 2018 (which is what we're running), but from the clippy warning, it seems that it'll change to ! (as RA says too), so we have to make this type explicit.

@gferon gferon merged commit b20a9fe into main Jul 8, 2024
19 checks passed
@gferon gferon deleted the clippy branch July 8, 2024 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants