From 21a0059755caa2f8a89a3d88287065b461778092 Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Mon, 7 Mar 2022 03:48:55 +0900 Subject: [PATCH] Follow clippy --- plume-common/src/activity_pub/mod.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/plume-common/src/activity_pub/mod.rs b/plume-common/src/activity_pub/mod.rs index 8a5f0fdc..99317c58 100644 --- a/plume-common/src/activity_pub/mod.rs +++ b/plume-common/src/activity_pub/mod.rs @@ -405,7 +405,7 @@ pub struct Hashtag07 { impl Hashtag07 { pub fn new() -> Self { - Hashtag07 { + Self { href: None, name: None, inner: Object07::new(), @@ -416,11 +416,11 @@ impl Hashtag07 { let href = inner.remove("href")?; let name = inner.remove("name")?; - Ok(Hashtag07 { href, name, inner }) + Ok(Self { href, name, inner }) } pub fn retracting(self) -> Result, serde_json::Error> { - let Hashtag07 { + let Self { href, name, mut inner, @@ -482,12 +482,18 @@ pub trait HashtagExt: AsHashtag { } } +impl Default for Hashtag07 { + fn default() -> Self { + Self::new() + } +} + impl AsHashtag for Hashtag07 { - fn hashtag_ref(&self) -> &Hashtag07 { + fn hashtag_ref(&self) -> &Self { self } - fn hashtag_mut(&mut self) -> &mut Hashtag07 { + fn hashtag_mut(&mut self) -> &mut Self { self } }