refactor!: return Path instead of Url from File.link_to (#3385)

This commit is contained in:
三咲雅 misaki masa 2025-11-30 12:08:59 +08:00 committed by GitHub
parent ade1025a74
commit 76196aab70
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 50 additions and 65 deletions

View file

@ -151,7 +151,7 @@ macro_rules! impl_file_fields {
($fields:ident) => {
$crate::cached_field!($fields, cha, |_, me| Ok($crate::Cha(me.cha)));
$crate::cached_field!($fields, url, |_, me| Ok($crate::Url::new(me.url_owned())));
$crate::cached_field!($fields, link_to, |_, me| Ok(me.link_to_url().map($crate::Url::new)));
$crate::cached_field!($fields, link_to, |_, me| Ok(me.link_to.as_ref().map($crate::Path::new)));
$crate::cached_field!($fields, name, |lua, me| {
me.name().map(|s| lua.create_string(s.encoded_bytes())).transpose()