mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-07-30 03:38:31 +00:00
Hot-Reloading Refactor
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
ae1a4fd283
commit
6c1434c165
212 changed files with 5679 additions and 4206 deletions
22
src/core/utils/defer.rs
Normal file
22
src/core/utils/defer.rs
Normal file
|
@ -0,0 +1,22 @@
|
|||
#[macro_export]
|
||||
macro_rules! defer {
|
||||
($body:block) => {
|
||||
struct _Defer_<F>
|
||||
where
|
||||
F: FnMut(),
|
||||
{
|
||||
closure: F,
|
||||
}
|
||||
|
||||
impl<F> Drop for _Defer_<F>
|
||||
where
|
||||
F: FnMut(),
|
||||
{
|
||||
fn drop(&mut self) { (self.closure)(); }
|
||||
}
|
||||
|
||||
let _defer_ = _Defer_ {
|
||||
closure: || $body,
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue