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

This commit is contained in:
Luna Yao
2026-04-27 12:29:46 +02:00
committed by GitHub
parent 969ecfc4ca
commit d5c4700d32
17 changed files with 56 additions and 958 deletions
@@ -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" 或空字符串)