chore: update to Rust 2024 edition
This commit is contained in:
parent
c3fafd3910
commit
2b7b4cba56
71 changed files with 254 additions and 292 deletions
|
|
@ -6,15 +6,15 @@ use std::{cell::RefCell, mem, rc::Rc, sync::LazyLock, thread, time::Duration};
|
|||
extern crate libpulse_binding as pulse;
|
||||
|
||||
use cosmic::{
|
||||
iced::{self, stream, Subscription},
|
||||
iced::{self, Subscription, stream},
|
||||
iced_futures::futures::{self, SinkExt},
|
||||
};
|
||||
|
||||
use libpulse_binding::{
|
||||
callbacks::ListResult,
|
||||
context::{
|
||||
introspect::{Introspector, SinkInfo, SourceInfo},
|
||||
Context,
|
||||
introspect::{Introspector, SinkInfo, SourceInfo},
|
||||
},
|
||||
error::PAErr,
|
||||
mainloop::standard::{IterateResult, Mainloop},
|
||||
|
|
@ -22,7 +22,7 @@ use libpulse_binding::{
|
|||
volume::ChannelVolumes,
|
||||
};
|
||||
|
||||
use tokio::sync::{mpsc, Mutex};
|
||||
use tokio::sync::{Mutex, mpsc};
|
||||
|
||||
pub static FROM_PULSE: LazyLock<Mutex<Option<(mpsc::Receiver<Message>, mpsc::Sender<Message>)>>> =
|
||||
LazyLock::new(|| Mutex::new(None));
|
||||
|
|
@ -508,22 +508,22 @@ impl PulseServer {
|
|||
match self.mainloop.borrow_mut().iterate(false) {
|
||||
IterateResult::Success(_) => {}
|
||||
IterateResult::Err(e) => {
|
||||
return Err(PulseServerError::IterateErr(IterateResult::Err(e)))
|
||||
return Err(PulseServerError::IterateErr(IterateResult::Err(e)));
|
||||
}
|
||||
IterateResult::Quit(e) => {
|
||||
return Err(PulseServerError::IterateErr(IterateResult::Quit(e)))
|
||||
return Err(PulseServerError::IterateErr(IterateResult::Quit(e)));
|
||||
}
|
||||
}
|
||||
|
||||
match self.context.borrow().get_state() {
|
||||
pulse::context::State::Ready => break,
|
||||
pulse::context::State::Failed => {
|
||||
return Err(PulseServerError::ContextErr(pulse::context::State::Failed))
|
||||
return Err(PulseServerError::ContextErr(pulse::context::State::Failed));
|
||||
}
|
||||
pulse::context::State::Terminated => {
|
||||
return Err(PulseServerError::ContextErr(
|
||||
pulse::context::State::Terminated,
|
||||
))
|
||||
));
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
|
@ -757,10 +757,10 @@ impl PulseServer {
|
|||
loop {
|
||||
match self.mainloop.borrow_mut().iterate(false) {
|
||||
IterateResult::Err(e) => {
|
||||
return Err(PulseServerError::IterateErr(IterateResult::Err(e)))
|
||||
return Err(PulseServerError::IterateErr(IterateResult::Err(e)));
|
||||
}
|
||||
IterateResult::Quit(e) => {
|
||||
return Err(PulseServerError::IterateErr(IterateResult::Quit(e)))
|
||||
return Err(PulseServerError::IterateErr(IterateResult::Quit(e)));
|
||||
}
|
||||
IterateResult::Success(_) => {}
|
||||
}
|
||||
|
|
@ -770,7 +770,7 @@ impl PulseServer {
|
|||
pulse::operation::State::Cancelled => {
|
||||
return Err(PulseServerError::OperationErr(
|
||||
pulse::operation::State::Cancelled,
|
||||
))
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue