Skip to content

Commit

Permalink
chore: rm needless pass by ref mut (alloy-rs#1465)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoratger authored Oct 14, 2024
1 parent f104f51 commit 517693c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/pubsub/src/managers/active_sub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ impl ActiveSubscription {

/// Notify the subscription channel of a new value, if any receiver exists.
/// If no receiver exists, the notification is dropped.
pub(crate) fn notify(&mut self, notification: Box<RawValue>) {
pub(crate) fn notify(&self, notification: Box<RawValue>) {
if self.tx.receiver_count() > 0 {
let _ = self.tx.send(notification);
}
Expand Down
2 changes: 1 addition & 1 deletion crates/pubsub/src/managers/sub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl SubscriptionManager {
/// exists, the notification is dropped.
pub(crate) fn notify(&mut self, notification: EthNotification) {
if let Some(local_id) = self.local_id_for(&notification.subscription) {
if let Some((_, mut sub)) = self.local_to_sub.remove_by_left(&local_id) {
if let Some((_, sub)) = self.local_to_sub.remove_by_left(&local_id) {
sub.notify(notification.result);
self.local_to_sub.insert(local_id, sub);
}
Expand Down
4 changes: 2 additions & 2 deletions crates/pubsub/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ impl<T: PubSubConnect> PubSubService<T> {
}

/// Dispatch a request to the socket.
fn dispatch_request(&mut self, brv: Box<RawValue>) -> TransportResult<()> {
fn dispatch_request(&self, brv: Box<RawValue>) -> TransportResult<()> {
self.handle.to_socket.send(brv).map(drop).map_err(|_| TransportErrorKind::backend_gone())
}

Expand All @@ -123,7 +123,7 @@ impl<T: PubSubConnect> PubSubService<T> {
/// the subscription does not exist, the waiter is sent nothing, and the
/// `tx` is dropped. This notifies the waiter that the subscription does
/// not exist.
fn service_get_sub(&mut self, local_id: B256, tx: oneshot::Sender<RawSubscription>) {
fn service_get_sub(&self, local_id: B256, tx: oneshot::Sender<RawSubscription>) {
if let Some(rx) = self.subs.get_subscription(local_id) {
let _ = tx.send(rx);
}
Expand Down

0 comments on commit 517693c

Please sign in to comment.