mirror of
https://github.com/talwat/lowfi
synced 2026-06-19 06:03:17 +00:00
fix: cleanup and linter warnings
This commit is contained in:
parent
1d7963fdc8
commit
c0ebdb057f
@ -152,15 +152,13 @@ impl List {
|
|||||||
.ok_or(tracks::error::Kind::InvalidName)?,
|
.ok_or(tracks::error::Kind::InvalidName)?,
|
||||||
};
|
};
|
||||||
|
|
||||||
let name = name;
|
|
||||||
|
|
||||||
Ok(Self::new(name, &text, path.to_str()))
|
Ok(Self::new(name, &text, path.to_str()))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Parses text into a [List].
|
/// Parses text into a [List].
|
||||||
pub fn new(name: &str, text: &str, path: Option<&str>) -> Self {
|
pub fn new(name: &str, text: &str, path: Option<&str>) -> Self {
|
||||||
// Get rid of special noheader case for tracklists without a header.
|
// Get rid of special noheader case for tracklists without a header.
|
||||||
let text = text.strip_prefix("noheader").unwrap_or_else(|| text);
|
let text = text.strip_prefix("noheader").unwrap_or(text);
|
||||||
|
|
||||||
let lines: Vec<String> = text
|
let lines: Vec<String> = text
|
||||||
.trim_end()
|
.trim_end()
|
||||||
@ -183,8 +181,8 @@ impl List {
|
|||||||
.join(format!("{tracks}.txt"));
|
.join(format!("{tracks}.txt"));
|
||||||
|
|
||||||
if path.exists() {
|
if path.exists() {
|
||||||
return Ok(Self::from_file(path, Some(tracks)).await?);
|
return Self::from_file(path, Some(tracks)).await;
|
||||||
};
|
}
|
||||||
|
|
||||||
if tracks == "chillhop" {
|
if tracks == "chillhop" {
|
||||||
#[cfg(feature = "default-tracklist")]
|
#[cfg(feature = "default-tracklist")]
|
||||||
@ -198,6 +196,6 @@ impl List {
|
|||||||
return Err(tracks::error::Kind::NoTrackList.into());
|
return Err(tracks::error::Kind::NoTrackList.into());
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(Self::from_file(tracks, None).await?)
|
Self::from_file(tracks, None).await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user