[librsvg: 7/8] Box parsed LanguageTag in CSS property
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 7/8] Box parsed LanguageTag in CSS property
- Date: Fri, 15 Oct 2021 21:01:05 +0000 (UTC)
commit 28ae2e81cb65d524e9d92a4c1d5b27160a0ca747
Author: Michael Howell <michael notriddle com>
Date: Fri Oct 15 09:57:57 2021 -0700
Box parsed LanguageTag in CSS property
Storing a parsed LanguageTag like that raised the size of the ComputedValues
struct from 536 to 584.
Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/606>
src/property_defs.rs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/property_defs.rs b/src/property_defs.rs
index 4923667e..ff6818a8 100644
--- a/src/property_defs.rs
+++ b/src/property_defs.rs
@@ -1090,7 +1090,7 @@ make_property!(
XmlLang,
default: None,
inherits_automatically: true,
- newtype: Option<LanguageTag>,
+ newtype: Option<Box<LanguageTag>>,
parse_impl: {
impl Parse for XmlLang {
fn parse<'i>(
@@ -1100,7 +1100,7 @@ make_property!(
let language_tag = LanguageTag::from_str(language_tag).map_err(|_| {
parser.new_custom_error(ValueErrorKind::parse_error("invalid syntax for 'xml:lang'
parameter"))
})?;
- Ok(XmlLang(Some(language_tag)))
+ Ok(XmlLang(Some(Box::new(language_tag))))
}
}
},
@@ -1111,7 +1111,7 @@ make_property!(
fn parses_xml_lang() {
assert_eq!(
XmlLang::parse_str("es-MX").unwrap(),
- XmlLang(Some(LanguageTag::from_str("es-MX").unwrap()))
+ XmlLang(Some(Box::new(LanguageTag::from_str("es-MX").unwrap())))
);
assert!(XmlLang::parse_str("").is_err());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]