Replace derive Element with derive IntoAnyElement everywhere
This commit is contained in:
parent
315744ec20
commit
8ecfea55cd
45 changed files with 185 additions and 292 deletions
|
@ -3,7 +3,7 @@ use std::marker::PhantomData;
|
|||
use crate::prelude::*;
|
||||
use crate::{Avatar, Player};
|
||||
|
||||
#[derive(Element)]
|
||||
#[derive(IntoAnyElement)]
|
||||
pub struct Facepile<S: 'static + Send + Sync> {
|
||||
state_type: PhantomData<S>,
|
||||
players: Vec<Player>,
|
||||
|
@ -17,7 +17,7 @@ impl<S: 'static + Send + Sync> Facepile<S> {
|
|||
}
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl IntoAnyElement<S> {
|
||||
fn render(self, _view: &mut S, cx: &mut ViewContext<S>) -> impl IntoAnyElement<S> {
|
||||
let player_count = self.players.len();
|
||||
let player_list = self.players.iter().enumerate().map(|(ix, player)| {
|
||||
let isnt_last = ix < player_count - 1;
|
||||
|
@ -39,7 +39,7 @@ mod stories {
|
|||
|
||||
use super::*;
|
||||
|
||||
#[derive(Element)]
|
||||
#[derive(IntoAnyElement)]
|
||||
pub struct FacepileStory<S: 'static + Send + Sync> {
|
||||
state_type: PhantomData<S>,
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ mod stories {
|
|||
}
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl IntoAnyElement<S> {
|
||||
fn render(self, _view: &mut S, cx: &mut ViewContext<S>) -> impl IntoAnyElement<S> {
|
||||
let players = static_players();
|
||||
|
||||
Story::container(cx)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue