utils: replace defer, ContextGuard, DetachableTask with guarden crate (#2163)

This commit is contained in:
Luna Yao authored and GitHub committed 2026-04-27 18:29:46 +08:00
1 parent 969ecfc4ca
commit d5c4700d32
17 files changed
+56 -958

No files matched your search

@@ -1,6 +1,5 @@
// translated from tailscale #32ce1bdb48078ec4cedaeeb5b1b2ff9c0ef61a49
use crate::defer;
use anyhow::{Context, Result};
use dbus::blocking::stdintf::org_freedesktop_dbus::Properties as _;
use std::fs;
@@ -167,6 +166,7 @@ fn new_os_configurator(_interface_name: String) -> Result<()> {
Ok(())
}
use guarden::defer;
use std::io::{self, BufRead, Cursor};
/// 返回 `resolv.conf` 内容的拥有者("systemd-resolved"、"NetworkManager"、"resolvconf" 或空字符串)