From a209f20f1831255228d2e5b0b664a57965e9ea40 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Mon, 24 Nov 2025 14:03:51 +0800 Subject: [PATCH] feat!: introduce `Path` as a subset of `Url` to enforce type safety --- yazi-binding/src/path.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/yazi-binding/src/path.rs b/yazi-binding/src/path.rs index a18dbd5e..be37b940 100644 --- a/yazi-binding/src/path.rs +++ b/yazi-binding/src/path.rs @@ -115,6 +115,9 @@ impl UserData for Path { cached_field!(fields, stem, |lua, me| { me.stem().map(|s| lua.create_string(s.encoded_bytes())).transpose() }); + + fields.add_field_method_get("is_absolute", |_, me| Ok(me.is_absolute())); + fields.add_field_method_get("has_root", |_, me| Ok(me.has_root())); } fn add_methods>(methods: &mut M) {