feat!: introduce Path as a subset of Url to enforce type safety

This commit is contained in:
sxyazi 2025-11-24 14:03:51 +08:00
parent 76fe6d7244
commit a209f20f18
No known key found for this signature in database

View file

@ -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<M: UserDataMethods<Self>>(methods: &mut M) {