fix Exit; document Size

This commit is contained in:
facile pop culture reference 2026-06-25 10:56:13 +03:00
parent 0273d2ac75
commit cb382cf12e
3 changed files with 8 additions and 4 deletions

2
dizzle

@ -1 +1 @@
Subproject commit 2dbf9d8797a3642f69813be4ef3613836e061b94
Subproject commit 4da276af7be5690f0a7a763de3710433a9700c3c

View file

@ -4,7 +4,7 @@ use crate::Usually;
#[derive(Clone)] pub struct Exit(Arc<AtomicBool>);
impl Exit {
pub fn run <T> (run: impl Fn(Self)->Usually<T>) -> Usually<T> {
pub fn run <T> (run: impl FnOnce(Self)->Usually<T>) -> Usually<T> {
run(Self(Arc::new(AtomicBool::new(false))))
}
}

View file

@ -3,7 +3,12 @@ use super::*;
/// Uses [AtomicUsize] to measure size during\
/// rendering (which is normally read-only).
#[derive(Default, Debug, Clone)]
pub struct Size(Arc<AtomicUsize>, Arc<AtomicUsize>);
pub struct Size(
/// Width
pub Arc<AtomicUsize>,
/// Height
pub Arc<AtomicUsize>,
);
impl PartialEq for Size {
fn eq (&self, _: &Self) -> bool {
@ -31,4 +36,3 @@ impl Size {
})
}
}