From 4a2e742e56c786e49ea4035c3bc3d1d068cf4443 Mon Sep 17 00:00:00 2001 From: unspeaker Date: Sat, 24 May 2025 00:30:22 +0300 Subject: [PATCH] dilemma --- crates/app/src/view.rs | 12 +++++++++--- deps/tengri | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/crates/app/src/view.rs b/crates/app/src/view.rs index 381bd1fa..334ceb5d 100644 --- a/crates/app/src/view.rs +++ b/crates/app/src/view.rs @@ -4,6 +4,11 @@ pub(crate) use ::tengri::tui::ratatui::prelude::Position; // Thunks can be natural error boundaries! struct ErrorBoundary>(std::marker::PhantomData, Perhaps); +impl> ErrorBoundary { + pub fn new (content: Perhaps) -> Self { + Self(Default::default(), content) + } +} impl> Content for ErrorBoundary { fn content (&self) -> impl Render + '_ { ThunkRender::new(|to|match self.1.as_ref() { @@ -19,9 +24,10 @@ impl> Content for ErrorBoundary { impl App { pub fn view (model: &Self) -> impl Content + '_ { - ErrorBoundary:: + '_>>( - Default::default(), - Give::give(model, &mut model.config.view.clone()) + ErrorBoundary::new( + Ok(Some(Tui::bg(Black, "give or take"))) + //Default::default(), Take::take(model, &mut model.config.view.clone()) + //Default::default(), Give::give(model, &mut model.config.view.clone()) ) } } diff --git a/deps/tengri b/deps/tengri index cbd28a59..5a2177cc 160000 --- a/deps/tengri +++ b/deps/tengri @@ -1 +1 @@ -Subproject commit cbd28a5934a7a2a9f7c48faa92bfe7ba52440919 +Subproject commit 5a2177cc77fd8827b565a2bf08c18d6bc25ea0dd