From 860798a28518b8dccd28433b34102961a0e09045 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Tue, 15 Jul 2025 06:58:58 +0200 Subject: refactor(crates/yt/comments): Remove dead code --- crates/yt/src/comments/comment.rs | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/crates/yt/src/comments/comment.rs b/crates/yt/src/comments/comment.rs index d9e3036..30b8ea0 100644 --- a/crates/yt/src/comments/comment.rs +++ b/crates/yt/src/comments/comment.rs @@ -15,22 +15,11 @@ use url::Url; #[derive(Debug, Deserialize, Serialize, Clone, Eq, PartialEq, PartialOrd, Ord)] #[serde(from = "String")] #[serde(deny_unknown_fields)] -pub enum Parent { +pub(crate) enum Parent { Root, Id(String), } -impl Parent { - #[must_use] - pub fn id(&self) -> Option<&str> { - if let Self::Id(id) = self { - Some(id) - } else { - None - } - } -} - impl From for Parent { fn from(value: String) -> Self { if value == "root" { @@ -51,7 +40,7 @@ impl From for Id { fn from(value: String) -> Self { Self { // Take the last element if the string is split with dots, otherwise take the full id - id: value.split('.').last().unwrap_or(&value).to_owned(), + id: value.split('.').next_back().unwrap_or(&value).to_owned(), } } } -- cgit 1.4.1