diff --git a/Cargo.toml b/Cargo.toml index 4203e8e..2485421 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "rustypipe" version = "0.1.3" -rust-version = "1.67.1" edition.workspace = true authors.workspace = true license.workspace = true diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 3ba9b45..53556b8 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "rustypipe-cli" version = "0.1.0" -rust-version = "1.74.0" edition.workspace = true authors.workspace = true license.workspace = true diff --git a/codegen/Cargo.toml b/codegen/Cargo.toml index 7a0e5d1..c47f1df 100644 --- a/codegen/Cargo.toml +++ b/codegen/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "rustypipe-codegen" version = "0.1.0" -rust-version = "1.74.0" edition.workspace = true authors.workspace = true license.workspace = true diff --git a/codegen/src/model.rs b/codegen/src/model.rs index 0f445a6..f7599cf 100644 --- a/codegen/src/model.rs +++ b/codegen/src/model.rs @@ -67,12 +67,12 @@ pub struct TimeAgo { pub unit: TimeUnit, } -impl std::fmt::Display for TimeAgo { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { +impl ToString for TimeAgo { + fn to_string(&self) -> String { if self.n > 1 { - write!(f, "{}{}", self.n, self.unit.as_str()) + format!("{}{}", self.n, self.unit.as_str()) } else { - f.write_str(self.unit.as_str()) + self.unit.as_str().to_owned() } } } diff --git a/downloader/Cargo.toml b/downloader/Cargo.toml index 7f0190d..1479524 100644 --- a/downloader/Cargo.toml +++ b/downloader/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "rustypipe-downloader" version = "0.1.0" -rust-version = "1.67.1" edition.workspace = true authors.workspace = true license.workspace = true diff --git a/src/client/player.rs b/src/client/player.rs index d95043e..ba1bee8 100644 --- a/src/client/player.rs +++ b/src/client/player.rs @@ -429,7 +429,7 @@ fn deobf_nsig( } else { let nsig = deobf.deobfuscate_nsig(n)?; last_nsig[0] = n.to_string(); - last_nsig[1].clone_from(&nsig); + last_nsig[1] = nsig.clone(); nsig }; diff --git a/src/client/response/music_item.rs b/src/client/response/music_item.rs index dc29688..4aa0b50 100644 --- a/src/client/response/music_item.rs +++ b/src/client/response/music_item.rs @@ -721,7 +721,7 @@ impl MusicListMapper { .unwrap_or_default() })) { - artists.clone_from(fb_artists); + artists = fb_artists.clone(); } } @@ -787,7 +787,7 @@ impl MusicListMapper { // fall back to menu data if let Some(a1) = artists.first_mut() { if a1.id.is_none() { - a1.id.clone_from(&artist_id); + a1.id = artist_id.clone(); } } diff --git a/src/model/mod.rs b/src/model/mod.rs index 1a6029d..8b695b4 100644 --- a/src/model/mod.rs +++ b/src/model/mod.rs @@ -68,9 +68,9 @@ pub enum UrlTarget { }, } -impl std::fmt::Display for UrlTarget { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.write_str(&self.to_url()) +impl ToString for UrlTarget { + fn to_string(&self) -> String { + self.to_url() } } diff --git a/src/serializer/text.rs b/src/serializer/text.rs index f146e7f..b708625 100644 --- a/src/serializer/text.rs +++ b/src/serializer/text.rs @@ -658,12 +658,9 @@ impl TextComponents { } } -impl std::fmt::Display for TextComponents { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - for t in &self.0 { - f.write_str(t.as_str())?; - } - Ok(()) +impl ToString for TextComponents { + fn to_string(&self) -> String { + self.0.iter().map(TextComponent::as_str).collect::() } } diff --git a/src/util/mod.rs b/src/util/mod.rs index 75dcb00..d11c66c 100644 --- a/src/util/mod.rs +++ b/src/util/mod.rs @@ -284,7 +284,6 @@ pub fn div_ceil(a: u32, b: u32) -> u32 { } } -#[allow(dead_code)] pub trait TryRemove { /// Removes and returns the element at position `index` within the vector, /// shifting all elements after it to the left.