From 614c0df0537567c75f781df7affc091a4a466226 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Tue, 15 Nov 2022 20:38:32 +0000 Subject: clippy --- azalea-client/src/plugins.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'azalea-client/src/plugins.rs') diff --git a/azalea-client/src/plugins.rs b/azalea-client/src/plugins.rs index 1a3aa049..150d5960 100644 --- a/azalea-client/src/plugins.rs +++ b/azalea-client/src/plugins.rs @@ -7,19 +7,21 @@ use std::{ hash::BuildHasherDefault, }; +type U64Hasher = BuildHasherDefault>; + // kind of based on https://docs.rs/http/latest/src/http/extensions.rs.html /// A map of plugin ids to Plugin trait objects. The client stores this so we /// can keep the state for our plugins. /// /// If you're using azalea, you should generate this from the `plugins!` macro. -#[derive(Clone)] +#[derive(Clone, Default)] pub struct Plugins { - map: Option, BuildHasherDefault>>>, + map: Option, U64Hasher>>, } impl Plugins { pub fn new() -> Self { - Self { map: None } + Self::default() } pub fn add(&mut self, plugin: T) { @@ -46,7 +48,7 @@ impl IntoIterator for Plugins { fn into_iter(self) -> Self::IntoIter { self.map - .map(|map| map.into_iter().map(|(_, v)| v).collect::>()) + .map(|map| map.into_values().collect::>()) .unwrap_or_default() .into_iter() } -- cgit v1.2.3