From 95d1dfd7740caa3b3081664d01c268ae538c0125 Mon Sep 17 00:00:00 2001 From: Paul Lietar Date: Fri, 19 Feb 2016 00:03:08 +0000 Subject: [PATCH] Make recipient of SpircManager methods non-mut. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SpircManager has interior mutability using a Mutex. There’s no need to make it’s methods take a mut reference. --- src/spirc.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/spirc.rs b/src/spirc.rs index 596d4c34..41ffc890 100644 --- a/src/spirc.rs +++ b/src/spirc.rs @@ -75,7 +75,7 @@ impl SpircManager { }))) } - pub fn run(&mut self) { + pub fn run(&self) { let rx = { let mut internal = self.0.lock().unwrap(); @@ -115,28 +115,28 @@ impl SpircManager { self.0.lock().unwrap().devices.clone() } - pub fn send_play(&mut self, recipient: &str) { + pub fn send_play(&self, recipient: &str) { let mut internal = self.0.lock().unwrap(); CommandSender::new(&mut *internal, MessageType::kMessageTypePlay) .recipient(recipient) .send(); } - pub fn send_pause(&mut self, recipient: &str) { + pub fn send_pause(&self, recipient: &str) { let mut internal = self.0.lock().unwrap(); CommandSender::new(&mut *internal, MessageType::kMessageTypePause) .recipient(recipient) .send(); } - pub fn send_prev(&mut self, recipient: &str) { + pub fn send_prev(&self, recipient: &str) { let mut internal = self.0.lock().unwrap(); CommandSender::new(&mut *internal, MessageType::kMessageTypePrev) .recipient(recipient) .send(); } - pub fn send_next(&mut self, recipient: &str) { + pub fn send_next(&self, recipient: &str) { let mut internal = self.0.lock().unwrap(); CommandSender::new(&mut *internal, MessageType::kMessageTypeNext) .recipient(recipient)