mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
Make recipient of SpircManager methods non-mut.
SpircManager has interior mutability using a Mutex. There’s no need to make it’s methods take a mut reference.
This commit is contained in:
parent
72dc5025c0
commit
95d1dfd774
1 changed files with 5 additions and 5 deletions
10
src/spirc.rs
10
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)
|
||||
|
|
Loading…
Reference in a new issue