From d213fad06774c5da5868514f087e0949635be89c Mon Sep 17 00:00:00 2001 From: Edvin Bryntesson Date: Sat, 31 Aug 2024 13:25:35 +0200 Subject: [PATCH] make window_type static in trait --- pumpkin-inventory/src/lib.rs | 4 ++-- pumpkin-inventory/src/open_container.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pumpkin-inventory/src/lib.rs b/pumpkin-inventory/src/lib.rs index a019c298c..ff6c2a429 100644 --- a/pumpkin-inventory/src/lib.rs +++ b/pumpkin-inventory/src/lib.rs @@ -61,7 +61,7 @@ impl WindowType { } // Container needs Sync + Send to be able to be in async Server pub trait Container: Sync + Send { - fn window_type(&self) -> &WindowType; + fn window_type(&self) -> &'static WindowType; fn handle_item_change( &mut self, @@ -189,7 +189,7 @@ impl<'a> OptionallyCombinedContainer<'a> { } impl<'a> Container for OptionallyCombinedContainer<'a> { - fn window_type(&self) -> &WindowType { + fn window_type(&self) -> &'static WindowType { if let Some(container) = &self.container { container.window_type() } else { diff --git a/pumpkin-inventory/src/open_container.rs b/pumpkin-inventory/src/open_container.rs index 895f92f08..f5a361b2b 100644 --- a/pumpkin-inventory/src/open_container.rs +++ b/pumpkin-inventory/src/open_container.rs @@ -53,7 +53,7 @@ impl Chest { } } impl Container for Chest { - fn window_type(&self) -> &WindowType { + fn window_type(&self) -> &'static WindowType { &WindowType::Generic9x3 }