From b7141598dcc9d185df560c4006c6e944f0cc0374 Mon Sep 17 00:00:00 2001 From: NinekoTheCat Date: Sun, 24 Dec 2023 20:21:40 +0100 Subject: [PATCH] feat: appeased the clippy gods --- src/database/key_value/acl.rs | 2 +- src/service/acl/data.rs | 2 +- src/service/acl/mod.rs | 6 +++--- src/service/mod.rs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/database/key_value/acl.rs b/src/database/key_value/acl.rs index ef29b20b..a5eadc61 100644 --- a/src/database/key_value/acl.rs +++ b/src/database/key_value/acl.rs @@ -67,7 +67,7 @@ impl Data for KeyValueDatabase { None => return, }; set.insert(AclDatabaseEntry { - mode: mode, + mode, hostname: parsed_host, }); }); diff --git a/src/service/acl/data.rs b/src/service/acl/data.rs index bd5d918b..0d1efff4 100644 --- a/src/service/acl/data.rs +++ b/src/service/acl/data.rs @@ -24,7 +24,7 @@ pub enum AclMode { } impl AclMode { - pub fn to_emoji(&self) -> char { + pub fn to_emoji(self) -> char { match self { AclMode::Block => '❎', AclMode::Allow => '✅', diff --git a/src/service/acl/mod.rs b/src/service/acl/mod.rs index 586aa8d3..be9de6ac 100644 --- a/src/service/acl/mod.rs +++ b/src/service/acl/mod.rs @@ -44,7 +44,7 @@ impl Service { pub fn add_acl(&self, host: Host, mode: AclMode) -> crate::Result<()> { self.db.add_acl(AclDatabaseEntry { - mode: mode, + mode, hostname: host, }) } @@ -59,7 +59,7 @@ impl Service { ); return false; }; - return self.is_federation_with_allowed(hostname); + self.is_federation_with_allowed(hostname) } /// same as federation_with_allowed however it can work with the fedi_dest type @@ -70,7 +70,7 @@ impl Service { warn!("cannot deserialise hostname for server with name {:?}", srv); return false; }; - return self.is_federation_with_allowed(hostname); + self.is_federation_with_allowed(hostname) } /// is federation allowed with this particular server? pub fn is_federation_with_allowed(&self, server_host_name: Host) -> bool { diff --git a/src/service/mod.rs b/src/service/mod.rs index d3c64097..195e8a0e 100644 --- a/src/service/mod.rs +++ b/src/service/mod.rs @@ -122,7 +122,7 @@ impl Services { globals: globals::Service::load(db, config)?, acl: acl::Service { - db: db, + db, acl_config: acl_conf, }, })