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: rm needless pass by ref mut #1465

Merged
merged 1 commit into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
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