Compare commits

...

2 commits

Author SHA1 Message Date
45b9f2a627
chore: fix clippy lints
All checks were successful
CI / Test (push) Successful in 2m36s
2024-05-02 19:39:48 +02:00
5dbb288a49
chore: introduce MSRV 2024-05-02 18:46:21 +02:00
10 changed files with 21 additions and 13 deletions

View file

@ -1,6 +1,7 @@
[package] [package]
name = "rustypipe" name = "rustypipe"
version = "0.1.3" version = "0.1.3"
rust-version = "1.67.1"
edition.workspace = true edition.workspace = true
authors.workspace = true authors.workspace = true
license.workspace = true license.workspace = true

View file

@ -1,6 +1,7 @@
[package] [package]
name = "rustypipe-cli" name = "rustypipe-cli"
version = "0.1.0" version = "0.1.0"
rust-version = "1.74.0"
edition.workspace = true edition.workspace = true
authors.workspace = true authors.workspace = true
license.workspace = true license.workspace = true

View file

@ -1,6 +1,7 @@
[package] [package]
name = "rustypipe-codegen" name = "rustypipe-codegen"
version = "0.1.0" version = "0.1.0"
rust-version = "1.74.0"
edition.workspace = true edition.workspace = true
authors.workspace = true authors.workspace = true
license.workspace = true license.workspace = true

View file

@ -67,12 +67,12 @@ pub struct TimeAgo {
pub unit: TimeUnit, pub unit: TimeUnit,
} }
impl ToString for TimeAgo { impl std::fmt::Display for TimeAgo {
fn to_string(&self) -> String { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if self.n > 1 { if self.n > 1 {
format!("{}{}", self.n, self.unit.as_str()) write!(f, "{}{}", self.n, self.unit.as_str())
} else { } else {
self.unit.as_str().to_owned() f.write_str(self.unit.as_str())
} }
} }
} }

View file

@ -1,6 +1,7 @@
[package] [package]
name = "rustypipe-downloader" name = "rustypipe-downloader"
version = "0.1.0" version = "0.1.0"
rust-version = "1.67.1"
edition.workspace = true edition.workspace = true
authors.workspace = true authors.workspace = true
license.workspace = true license.workspace = true

View file

@ -429,7 +429,7 @@ fn deobf_nsig(
} else { } else {
let nsig = deobf.deobfuscate_nsig(n)?; let nsig = deobf.deobfuscate_nsig(n)?;
last_nsig[0] = n.to_string(); last_nsig[0] = n.to_string();
last_nsig[1] = nsig.clone(); last_nsig[1].clone_from(&nsig);
nsig nsig
}; };

View file

@ -721,7 +721,7 @@ impl MusicListMapper {
.unwrap_or_default() .unwrap_or_default()
})) }))
{ {
artists = fb_artists.clone(); artists.clone_from(fb_artists);
} }
} }
@ -787,7 +787,7 @@ impl MusicListMapper {
// fall back to menu data // fall back to menu data
if let Some(a1) = artists.first_mut() { if let Some(a1) = artists.first_mut() {
if a1.id.is_none() { if a1.id.is_none() {
a1.id = artist_id.clone(); a1.id.clone_from(&artist_id);
} }
} }

View file

@ -68,9 +68,9 @@ pub enum UrlTarget {
}, },
} }
impl ToString for UrlTarget { impl std::fmt::Display for UrlTarget {
fn to_string(&self) -> String { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
self.to_url() f.write_str(&self.to_url())
} }
} }

View file

@ -658,9 +658,12 @@ impl TextComponents {
} }
} }
impl ToString for TextComponents { impl std::fmt::Display for TextComponents {
fn to_string(&self) -> String { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
self.0.iter().map(TextComponent::as_str).collect::<String>() for t in &self.0 {
f.write_str(t.as_str())?;
}
Ok(())
} }
} }

View file

@ -284,6 +284,7 @@ pub fn div_ceil(a: u32, b: u32) -> u32 {
} }
} }
#[allow(dead_code)]
pub trait TryRemove<T> { pub trait TryRemove<T> {
/// Removes and returns the element at position `index` within the vector, /// Removes and returns the element at position `index` within the vector,
/// shifting all elements after it to the left. /// shifting all elements after it to the left.