mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-11 22:26:44 +01:00
wip: remove redundant type param
This commit is contained in:
parent
c033a5618b
commit
df3dac183e
12 changed files with 113 additions and 125 deletions
|
|
@ -1,26 +1,26 @@
|
|||
use crate::*;
|
||||
|
||||
pub struct Layered<'a, T, U>(Collection<'a, T, U>);
|
||||
pub struct Layered<'a, E: Engine>(Collection<'a, E>);
|
||||
|
||||
impl<'a, T, U> Layered<'a, T, U> {
|
||||
impl<'a, E: Engine> Layered<'a, E> {
|
||||
pub fn new () -> Self {
|
||||
Self(Collection::new())
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T, U> Collect<'a, T, U> for Layered<'a, T, U> {
|
||||
fn add_box (mut self, item: Box<dyn Render<T, U> + 'a>) -> Self {
|
||||
impl<'a, E: Engine> Collect<'a, E> for Layered<'a, E> {
|
||||
fn add_box (mut self, item: Box<dyn Render<E> + 'a>) -> Self {
|
||||
self.0 = self.0.add_box(item);
|
||||
self
|
||||
}
|
||||
fn add_ref (mut self, item: &'a dyn Render<T, U>) -> Self {
|
||||
fn add_ref (mut self, item: &'a dyn Render<E>) -> Self {
|
||||
self.0 = self.0.add_ref(item);
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Render<TuiContext, Rect> for Layered<'a, TuiContext, Rect> {
|
||||
fn render (&self, to: &mut TuiContext) -> Perhaps<Rect> {
|
||||
impl<'a> Render<Tui> for Layered<'a, Tui> {
|
||||
fn render (&self, to: &mut Tui) -> Perhaps<Rect> {
|
||||
let area = to.area();
|
||||
for layer in self.0.0.iter() {
|
||||
layer.render(to)?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue