update Justfile and fix some warnings

This commit is contained in:
🪞👃🪞 2025-01-09 18:56:32 +01:00
parent 9e4406c66a
commit b995f81a26
11 changed files with 67 additions and 84 deletions

View file

@ -2,11 +2,11 @@ use crate::*;
use std::marker::PhantomData;
use EdnItem::*;
pub type EdnCallback<'a, Output, State> =
dyn Fn(&'a State)-> RenderBox<'a, Output> + Send + Sync + 'a;
pub type EdnCallback<'a, O: Output, State> =
dyn Fn(&'a State)-> RenderBox<'a, O> + Send + Sync + 'a;
pub type EdnRenderCallback<'a, Output, State> =
Box<EdnCallback<'a, Output, State>>;
pub type EdnRenderCallback<'a, O: Output, State> =
Box<EdnCallback<'a, O, State>>;
/// Provides values to the template
pub trait EdnViewData<E: Output> {
@ -49,11 +49,10 @@ impl<E: Output, T: EdnViewData<E> + Send + Sync> Content<E> for EdnView<E, T> {
match_exp(s, &head.to_ref(), &tail)
} else {
panic!("todo: add error handling to content() chain. invalid expression {e:?}");
().boxed()
},
},
Self::Err(error) => {
Box::new(())//&format!("EdnView error: {error:?}"))
Self::Err(_error) => {
Box::new(())//&format!("EdnView error: {error:?}")) // FIXME: String is not Render
},
_ => todo!()
}

View file

@ -1,3 +1,4 @@
//#![feature(lazy_type_alias)]
#![feature(type_alias_impl_trait)]
#![feature(impl_trait_in_assoc_type)]
@ -29,10 +30,10 @@ pub(crate) use std::marker::PhantomData;
pub(crate) use std::error::Error;
/// Standard result type.
pub(crate) type Usually<T> = Result<T, Box<dyn Error>>;
pub type Usually<T> = Result<T, Box<dyn Error>>;
/// Standard optional result type.
pub(crate) type Perhaps<T> = Result<Option<T>, Box<dyn Error>>;
pub type Perhaps<T> = Result<Option<T>, Box<dyn Error>>;
#[cfg(test)] #[test] fn test_layout () -> Usually<()> {
use ::tek_tui::Tui;