This commit is contained in:
lbl
2026-02-10 18:20:39 +08:00
parent 71da72da34
commit b4301a8106
261 changed files with 20179 additions and 21547 deletions
+17
View File
@@ -0,0 +1,17 @@
mod service_http;
pub use service_http::run_http_server;
struct ScopeGuard<F: FnOnce()>(Option<F>);
impl<F: FnOnce()> Drop for ScopeGuard<F> {
fn drop(&mut self) {
if let Some(f) = self.0.take() {
f();
}
}
}
fn defer<F: FnOnce()>(f: F) -> ScopeGuard<F> {
ScopeGuard(Some(f))
}