upub/web/src/getters.rs
alemi ea655be121
fix(web): huge refactor but basically nothing changed
... yet! this fixes the weird bug that resets timeline scroll when
coming back from users (annoying!). also slightly better spacing for
things and more consistent loading buttons. its a big refactor and its
underway but there's so much in progress that ill commit this big chunk
as is and i totally wont regret it later when i need to remember what i
was moving where aha
2024-06-12 06:02:36 +02:00

11 lines
193 B
Rust

pub trait Getter<T: Default> {
/// .ok().unwrap_or_default()
fn want(self) -> T;
}
impl<T: Default> Getter<T> for apb::Field<T> {
fn want(self) -> T {
self.ok().unwrap_or_default()
}
}