Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Problem: sending any Whisper message fails #7421

Merged
merged 1 commit into from
Jan 2, 2018
Merged
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 parity/whisper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl PoolHandle for NetPoolHandle {
fn relay(&self, message: Message) -> bool {
let mut res = false;
let mut message = Some(message);
self.net.with_proto_context(whisper_net::PROTOCOL_ID, &mut move |ctx| {
self.net.with_proto_context(whisper_net::PROTOCOL_ID, &mut |ctx| {
Copy link
Contributor

@rphmeier rphmeier Jan 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a tricky one. nice catch!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a little disappointed that rustc doesn't give you a warning for unused_mut when the variable is only copied into a closure.

Minimal playpen: https://play.rust-lang.org/?gist=c66bc6098aeacddb71550878c0d887f9&version=stable

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if let Some(message) = message.take() {
res = self.handle.post_message(message, ctx);
}
Expand Down