yazi/yazi-shim/src/mlua/cache.rs
2026-06-09 22:52:43 +08:00

9 lines
203 B
Rust

use mlua::{Error::UserDataDestructed, Value};
pub(super) fn is_alive(v: &Value) -> bool {
if let Value::UserData(ud) = v {
!matches!(ud.borrow::<()>(), Err(UserDataDestructed))
} else {
true
}
}