Remove unneeded anonymous lifetimes from gpui::Context (#27686)

This PR removes a number of unneeded anonymous lifetimes from usages of
`gpui::Context`.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-03-28 15:26:30 -04:00 committed by GitHub
parent e90411efa2
commit b5dc09c0ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 80 additions and 87 deletions

View file

@ -25,7 +25,7 @@ impl AppContext for AsyncApp {
fn new<T: 'static>(
&mut self,
build_entity: impl FnOnce(&mut Context<'_, T>) -> T,
build_entity: impl FnOnce(&mut Context<T>) -> T,
) -> Self::Result<Entity<T>> {
let app = self
.app
@ -47,7 +47,7 @@ impl AppContext for AsyncApp {
fn insert_entity<T: 'static>(
&mut self,
reservation: Reservation<T>,
build_entity: impl FnOnce(&mut Context<'_, T>) -> T,
build_entity: impl FnOnce(&mut Context<T>) -> T,
) -> Result<Entity<T>> {
let app = self
.app
@ -60,7 +60,7 @@ impl AppContext for AsyncApp {
fn update_entity<T: 'static, R>(
&mut self,
handle: &Entity<T>,
update: impl FnOnce(&mut T, &mut Context<'_, T>) -> R,
update: impl FnOnce(&mut T, &mut Context<T>) -> R,
) -> Self::Result<R> {
let app = self
.app
@ -345,7 +345,7 @@ impl AsyncWindowContext {
impl AppContext for AsyncWindowContext {
type Result<T> = Result<T>;
fn new<T>(&mut self, build_entity: impl FnOnce(&mut Context<'_, T>) -> T) -> Result<Entity<T>>
fn new<T>(&mut self, build_entity: impl FnOnce(&mut Context<T>) -> T) -> Result<Entity<T>>
where
T: 'static,
{
@ -359,7 +359,7 @@ impl AppContext for AsyncWindowContext {
fn insert_entity<T: 'static>(
&mut self,
reservation: Reservation<T>,
build_entity: impl FnOnce(&mut Context<'_, T>) -> T,
build_entity: impl FnOnce(&mut Context<T>) -> T,
) -> Self::Result<Entity<T>> {
self.window
.update(self, |_, _, cx| cx.insert_entity(reservation, build_entity))
@ -368,7 +368,7 @@ impl AppContext for AsyncWindowContext {
fn update_entity<T: 'static, R>(
&mut self,
handle: &Entity<T>,
update: impl FnOnce(&mut T, &mut Context<'_, T>) -> R,
update: impl FnOnce(&mut T, &mut Context<T>) -> R,
) -> Result<R> {
self.window
.update(self, |_, _, cx| cx.update_entity(handle, update))