aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-07-15 06:58:58 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-07-15 06:58:58 +0200
commit860798a28518b8dccd28433b34102961a0e09045 (patch)
tree30bbda7181e4b78191737d35ff0f9d28ac30876e
parentfix(crates/yt/downloader): Correctly treat the download as blocking (diff)
downloadyt-860798a28518b8dccd28433b34102961a0e09045.zip
refactor(crates/yt/comments): Remove dead code
Diffstat (limited to '')
-rw-r--r--crates/yt/src/comments/comment.rs15
1 files 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<String> for Parent {
fn from(value: String) -> Self {
if value == "root" {
@@ -51,7 +40,7 @@ impl From<String> 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(),
}
}
}