-
Notifications
You must be signed in to change notification settings - Fork 227
Fix clippy and compiler warnings across client and server crates #1629
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -440,9 +440,9 @@ async fn is_connected_works() { | |
| } | ||
|
|
||
| async fn run_batch_request_with_response<T: Send + DeserializeOwned + std::fmt::Debug + Clone + 'static>( | ||
| batch: BatchRequestBuilder<'_>, | ||
| batch: BatchRequestBuilder<'static>, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As above |
||
| response: String, | ||
| ) -> Result<BatchResponse<T>, Error> { | ||
| ) -> Result<BatchResponse<'static, T>, Error> { | ||
| let server = WebSocketTestServer::with_hardcoded_response("127.0.0.1:0".parse().unwrap(), response) | ||
| .with_default_timeout() | ||
| .await | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,6 +63,7 @@ pub(crate) struct SubscriptionLagged(Arc<RwLock<bool>>); | |
| /// Owned version of [`RawResponse`]. | ||
| pub type RawResponseOwned = RawResponse<'static>; | ||
|
|
||
| #[allow(dead_code)] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All of these |
||
| impl SubscriptionLagged { | ||
| /// Create a new [`SubscriptionLagged`]. | ||
| pub(crate) fn new() -> Self { | ||
|
|
@@ -288,6 +289,7 @@ pub struct Subscription<Notif> { | |
| // but type type has no need to be pinned. | ||
| impl<Notif> std::marker::Unpin for Subscription<Notif> {} | ||
|
|
||
| #[allow(dead_code)] | ||
| impl<Notif> Subscription<Notif> { | ||
| /// Create a new subscription. | ||
| fn new(to_back: mpsc::Sender<FrontToBack>, rx: SubscriptionReceiver, kind: SubscriptionKind) -> Self { | ||
|
|
@@ -333,6 +335,7 @@ impl<Notif> Subscription<Notif> { | |
|
|
||
| /// Batch request message. | ||
| #[derive(Debug)] | ||
| #[allow(dead_code)] | ||
| struct BatchMessage { | ||
| /// Serialized batch request. | ||
| raw: String, | ||
|
|
@@ -344,6 +347,7 @@ struct BatchMessage { | |
|
|
||
| /// Request message. | ||
| #[derive(Debug)] | ||
| #[allow(dead_code)] | ||
| struct RequestMessage { | ||
| /// Serialized message. | ||
| raw: String, | ||
|
|
@@ -355,6 +359,7 @@ struct RequestMessage { | |
|
|
||
| /// Subscription message. | ||
| #[derive(Debug)] | ||
| #[allow(dead_code)] | ||
| struct SubscriptionMessage { | ||
| /// Serialized message. | ||
| raw: String, | ||
|
|
@@ -372,6 +377,7 @@ struct SubscriptionMessage { | |
|
|
||
| /// RegisterNotification message. | ||
| #[derive(Debug)] | ||
| #[allow(dead_code)] | ||
| struct RegisterNotificationMessage { | ||
| /// Method name this notification handler is attached to | ||
| method: String, | ||
|
|
@@ -383,6 +389,7 @@ struct RegisterNotificationMessage { | |
|
|
||
| /// Message that the Client can send to the background task. | ||
| #[derive(Debug)] | ||
| #[allow(dead_code)] | ||
| enum FrontToBack { | ||
| /// Send a batch request to the server. | ||
| Batch(BatchMessage), | ||
|
|
@@ -606,6 +613,7 @@ impl<'a, R> IntoIterator for BatchResponse<'a, R> { | |
| } | ||
|
|
||
| #[derive(thiserror::Error, Debug)] | ||
| #[allow(dead_code)] | ||
| enum TrySubscriptionSendError { | ||
| #[error("The subscription is closed")] | ||
| Closed, | ||
|
|
@@ -614,11 +622,13 @@ enum TrySubscriptionSendError { | |
| } | ||
|
|
||
| #[derive(Debug)] | ||
| #[allow(dead_code)] | ||
| pub(crate) struct SubscriptionSender { | ||
| inner: mpsc::Sender<Box<RawValue>>, | ||
| lagged: SubscriptionLagged, | ||
| } | ||
|
|
||
| #[allow(dead_code)] | ||
| impl SubscriptionSender { | ||
| fn send(&self, msg: Box<RawValue>) -> Result<(), TrySubscriptionSendError> { | ||
| match self.inner.try_send(msg) { | ||
|
|
@@ -646,6 +656,7 @@ impl Stream for SubscriptionReceiver { | |
| } | ||
| } | ||
|
|
||
| #[allow(dead_code)] | ||
| fn subscription_channel(max_buf_size: usize) -> (SubscriptionSender, SubscriptionReceiver) { | ||
| let (tx, rx) = mpsc::channel(max_buf_size); | ||
| let lagged_tx = SubscriptionLagged::new(); | ||
|
|
@@ -661,6 +672,7 @@ pub struct SubscriptionResponse { | |
| sub_id: SubscriptionId<'static>, | ||
| // The receiver is used to receive notifications from the server and shouldn't be exposed to the user | ||
| // from the middleware. | ||
| #[allow(dead_code)] | ||
| stream: SubscriptionReceiver, | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have thought that adding
'_fo theBatchResponsetype would also work here, but the proper equivalent would be adding a'alifetime in the generic params and using that. Elided / unnamed lifetimes aren't the same as static lifetimes.