Closes #ISSUE

Release Notes:

- N/A *or* Added/Fixed/Improved ...

---------

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
This commit is contained in:
Piotr Osiewicz
2025-02-28 18:33:35 +01:00
committed by GitHub
co-authored by Anthony Eid
parent fc52b43159
commit e4e758db3a
68 changed files with 180 additions and 190 deletions
+2 -2
View File
@@ -649,7 +649,7 @@ impl<'a, T: 'static> Context<'a, T> {
}
}
impl<'a, T> Context<'a, T> {
impl<T> Context<'_, T> {
/// Emit an event of the specified type, which can be handled by other entities that have subscribed via `subscribe` methods on their respective contexts.
pub fn emit<Evt>(&mut self, event: Evt)
where
@@ -664,7 +664,7 @@ impl<'a, T> Context<'a, T> {
}
}
impl<'a, T> AppContext for Context<'a, T> {
impl<T> AppContext for Context<'_, T> {
type Result<U> = U;
fn new<U: 'static>(
+3 -3
View File
@@ -191,7 +191,7 @@ pub(crate) struct Lease<'a, T> {
entity_type: PhantomData<T>,
}
impl<'a, T: 'static> core::ops::Deref for Lease<'a, T> {
impl<T: 'static> core::ops::Deref for Lease<'_, T> {
type Target = T;
fn deref(&self) -> &Self::Target {
@@ -199,13 +199,13 @@ impl<'a, T: 'static> core::ops::Deref for Lease<'a, T> {
}
}
impl<'a, T: 'static> core::ops::DerefMut for Lease<'a, T> {
impl<T: 'static> core::ops::DerefMut for Lease<'_, T> {
fn deref_mut(&mut self) -> &mut Self::Target {
self.entity.as_mut().unwrap().downcast_mut().unwrap()
}
}
impl<'a, T> Drop for Lease<'a, T> {
impl<T> Drop for Lease<'_, T> {
fn drop(&mut self) {
if self.entity.is_some() && !panicking() {
panic!("Leases must be ended with EntityMap::end_lease")