Calm down clippy
This commit is contained in:
parent
674e3b77ed
commit
d104354966
6 changed files with 10 additions and 14 deletions
|
@ -17,7 +17,7 @@ fn get_track_cover_art(artist: &Option<String>, title: &Option<String>) -> Optio
|
||||||
if let Some(ref artist) = artist {
|
if let Some(ref artist) = artist {
|
||||||
// Some artist fields might contain + characters
|
// Some artist fields might contain + characters
|
||||||
// Pointing at multiple artists
|
// Pointing at multiple artists
|
||||||
for part in artist.split("+") {
|
for part in artist.split('+') {
|
||||||
builder.and().artist(part);
|
builder.and().artist(part);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ fn get_album_cover_art(album_artist: &Option<String>, album: &Option<String>) -
|
||||||
if let Some(ref album_artist) = album_artist {
|
if let Some(ref album_artist) = album_artist {
|
||||||
// Some artist fields might contain + characters
|
// Some artist fields might contain + characters
|
||||||
// Pointing at multiple artists
|
// Pointing at multiple artists
|
||||||
for part in album_artist.split("+") {
|
for part in album_artist.split('+') {
|
||||||
builder.and().artist(part);
|
builder.and().artist(part);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,5 +22,5 @@ fn mpv_open_cplugin(handle: *mut mpv_handle) -> std::os::raw::c_int {
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin.run();
|
plugin.run();
|
||||||
return 0;
|
0
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,19 +49,19 @@ impl Logger {
|
||||||
|
|
||||||
pub fn info(&self, message: &str) {
|
pub fn info(&self, message: &str) {
|
||||||
if self.log_level >= LogLevel::Info {
|
if self.log_level >= LogLevel::Info {
|
||||||
println!("[mpv-rpc (INFO)] {}", message);
|
println!("[mpv-rpc (INFO)] {message}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn warning(&self, message: &str) {
|
pub fn warning(&self, message: &str) {
|
||||||
if self.log_level >= LogLevel::Warn {
|
if self.log_level >= LogLevel::Warn {
|
||||||
println!("[mpv-rpc (WARN)] {}", message);
|
println!("[mpv-rpc (WARN)] {message}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn error(&self, message: &str) {
|
pub fn error(&self, message: &str) {
|
||||||
if self.log_level >= LogLevel::Error {
|
if self.log_level >= LogLevel::Error {
|
||||||
println!("[mpv-rpc (ERROR)] {}", message);
|
println!("[mpv-rpc (ERROR)] {message}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ impl MpvEventQueue {
|
||||||
Ok(new_self)
|
Ok(new_self)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn from_ptr<'a>(handle: *mut mpv_handle, logger: Rc<Logger>) -> Result<Self, &'static str> {
|
pub fn from_ptr(handle: *mut mpv_handle, logger: Rc<Logger>) -> Result<Self, &'static str> {
|
||||||
MpvEventQueue::new(Handle::from_ptr(handle), logger)
|
MpvEventQueue::new(Handle::from_ptr(handle), logger)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,8 +42,7 @@ impl MpvEventQueue {
|
||||||
|
|
||||||
pub fn next_event(&mut self) -> Option<MpvEvent> {
|
pub fn next_event(&mut self) -> Option<MpvEvent> {
|
||||||
let event = self.mpv.wait_event(-1.0);
|
let event = self.mpv.wait_event(-1.0);
|
||||||
let mpv_event = self.convert_event(event);
|
self.convert_event(event)
|
||||||
mpv_event
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_request(&self, request: MpvRequest) -> Result<(), &'static str> {
|
pub fn handle_request(&self, request: MpvRequest) -> Result<(), &'static str> {
|
||||||
|
|
|
@ -30,5 +30,5 @@ pub trait MpvEventHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait MpvRequester {
|
pub trait MpvRequester {
|
||||||
fn next_request<'a>(&mut self) -> Option<MpvRequest>;
|
fn next_request(&mut self) -> Option<MpvRequest>;
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,10 +48,7 @@ impl RPCPlugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_event(&mut self, event: MpvEvent) -> bool {
|
fn handle_event(&mut self, event: MpvEvent) -> bool {
|
||||||
let exit = match event {
|
let exit = matches!(event, MpvEvent::Exit);
|
||||||
MpvEvent::Exit => true,
|
|
||||||
_ => false
|
|
||||||
};
|
|
||||||
|
|
||||||
if let Err(e) = self.discord.handle_event(event) {
|
if let Err(e) = self.discord.handle_event(event) {
|
||||||
logging::error!(self.logger, "Failed to handle event: {e}");
|
logging::error!(self.logger, "Failed to handle event: {e}");
|
||||||
|
|
Loading…
Reference in a new issue