Skip to content

Commit a209f20

Browse files
committed
feat!: introduce Path as a subset of Url to enforce type safety
1 parent 76fe6d7 commit a209f20

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

yazi-binding/src/path.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ impl UserData for Path {
115115
cached_field!(fields, stem, |lua, me| {
116116
me.stem().map(|s| lua.create_string(s.encoded_bytes())).transpose()
117117
});
118+
119+
fields.add_field_method_get("is_absolute", |_, me| Ok(me.is_absolute()));
120+
fields.add_field_method_get("has_root", |_, me| Ok(me.has_root()));
118121
}
119122

120123
fn add_methods<M: UserDataMethods<Self>>(methods: &mut M) {

0 commit comments

Comments
 (0)