chore: cargo clippy --fix
This commit is contained in:
@@ -188,7 +188,7 @@ impl Queue {
|
|||||||
pub fn remove(&self, index: usize) {
|
pub fn remove(&self, index: usize) {
|
||||||
{
|
{
|
||||||
let mut q = self.queue.write().unwrap();
|
let mut q = self.queue.write().unwrap();
|
||||||
if q.len() == 0 {
|
if q.is_empty() {
|
||||||
info!("queue is empty");
|
info!("queue is empty");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -365,7 +365,7 @@ impl Queue {
|
|||||||
if repeat == RepeatSetting::RepeatTrack && manual {
|
if repeat == RepeatSetting::RepeatTrack && manual {
|
||||||
self.set_repeat(RepeatSetting::RepeatPlaylist);
|
self.set_repeat(RepeatSetting::RepeatPlaylist);
|
||||||
}
|
}
|
||||||
} else if repeat == RepeatSetting::RepeatPlaylist && q.len() > 0 {
|
} else if repeat == RepeatSetting::RepeatPlaylist && !q.is_empty() {
|
||||||
let random_order = self.random_order.read().unwrap();
|
let random_order = self.random_order.read().unwrap();
|
||||||
self.play(
|
self.play(
|
||||||
random_order.as_ref().map(|o| o[0]).unwrap_or(0),
|
random_order.as_ref().map(|o| o[0]).unwrap_or(0),
|
||||||
@@ -385,7 +385,7 @@ impl Queue {
|
|||||||
|
|
||||||
if let Some(index) = self.previous_index() {
|
if let Some(index) = self.previous_index() {
|
||||||
self.play(index, false, false);
|
self.play(index, false, false);
|
||||||
} else if repeat == RepeatSetting::RepeatPlaylist && q.len() > 0 {
|
} else if repeat == RepeatSetting::RepeatPlaylist && !q.is_empty() {
|
||||||
if self.get_shuffle() {
|
if self.get_shuffle() {
|
||||||
let random_order = self.random_order.read().unwrap();
|
let random_order = self.random_order.read().unwrap();
|
||||||
self.play(
|
self.play(
|
||||||
|
|||||||
@@ -267,7 +267,7 @@ impl View for Layout {
|
|||||||
fn draw(&self, printer: &Printer<'_, '_>) {
|
fn draw(&self, printer: &Printer<'_, '_>) {
|
||||||
let result = self.get_result();
|
let result = self.get_result();
|
||||||
|
|
||||||
let cmdline_visible = self.cmdline.get_content().len() > 0;
|
let cmdline_visible = !self.cmdline.get_content().is_empty();
|
||||||
let mut cmdline_height = usize::from(cmdline_visible);
|
let mut cmdline_height = usize::from(cmdline_visible);
|
||||||
if result.as_ref().map(Option::is_some).unwrap_or(true) {
|
if result.as_ref().map(Option::is_some).unwrap_or(true) {
|
||||||
cmdline_height += 1;
|
cmdline_height += 1;
|
||||||
@@ -411,7 +411,7 @@ impl View for Layout {
|
|||||||
|
|
||||||
let result = self.get_result();
|
let result = self.get_result();
|
||||||
|
|
||||||
let cmdline_visible = self.cmdline.get_content().len() > 0;
|
let cmdline_visible = !self.cmdline.get_content().is_empty();
|
||||||
let mut cmdline_height = usize::from(cmdline_visible);
|
let mut cmdline_height = usize::from(cmdline_visible);
|
||||||
if result.as_ref().map(Option::is_some).unwrap_or(true) {
|
if result.as_ref().map(Option::is_some).unwrap_or(true) {
|
||||||
cmdline_height += 1;
|
cmdline_height += 1;
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ pub fn ms_to_hms(duration: u32) -> String {
|
|||||||
|
|
||||||
pub fn cache_path_for_url(url: String) -> std::path::PathBuf {
|
pub fn cache_path_for_url(url: String) -> std::path::PathBuf {
|
||||||
let mut path = crate::config::cache_path("covers");
|
let mut path = crate::config::cache_path("covers");
|
||||||
path.push(url.split('/').last().unwrap());
|
path.push(url.split('/').next_back().unwrap());
|
||||||
path
|
path
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user