functions no longer modify state, funcrefs exist

you can use &func as a function, too.
this allows the function to mutate its
inner state.
This commit is contained in:
Mark
2024-07-01 20:51:09 +02:00
parent 7acaafaa2f
commit 18cd3ee0ae
21 changed files with 330 additions and 191 deletions

View File

@@ -11,7 +11,7 @@ pub fn to_mers_func(
run: impl Fn(Data) -> Result<Data, CheckError> + Send + Sync + 'static,
) -> data::function::Function {
data::function::Function {
info: Arc::new(Info::neverused()),
info: Info::neverused(),
info_check: Arc::new(Mutex::new(Info::neverused())),
out: Arc::new(move |a, _| out(a)),
run: Arc::new(move |a, _| run(a)),