make window_type static in trait
This commit is contained in:
parent
1d065645e1
commit
d213fad067
@ -61,7 +61,7 @@ impl WindowType {
|
|||||||
}
|
}
|
||||||
// Container needs Sync + Send to be able to be in async Server
|
// Container needs Sync + Send to be able to be in async Server
|
||||||
pub trait Container: Sync + Send {
|
pub trait Container: Sync + Send {
|
||||||
fn window_type(&self) -> &WindowType;
|
fn window_type(&self) -> &'static WindowType;
|
||||||
|
|
||||||
fn handle_item_change(
|
fn handle_item_change(
|
||||||
&mut self,
|
&mut self,
|
||||||
@ -189,7 +189,7 @@ impl<'a> OptionallyCombinedContainer<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Container for 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 {
|
if let Some(container) = &self.container {
|
||||||
container.window_type()
|
container.window_type()
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -53,7 +53,7 @@ impl Chest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
impl Container for Chest {
|
impl Container for Chest {
|
||||||
fn window_type(&self) -> &WindowType {
|
fn window_type(&self) -> &'static WindowType {
|
||||||
&WindowType::Generic9x3
|
&WindowType::Generic9x3
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user