make window_type static in trait

This commit is contained in:
Edvin Bryntesson 2024-08-31 13:25:35 +02:00
parent 1d065645e1
commit d213fad067
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

View File

@ -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 {

View File

@ -53,7 +53,7 @@ impl Chest {
}
}
impl Container for Chest {
fn window_type(&self) -> &WindowType {
fn window_type(&self) -> &'static WindowType {
&WindowType::Generic9x3
}