mirror of
https://github.com/servo/servo.git
synced 2025-08-08 06:55:31 +01:00
style: Simplify ImageValue.
Bug: 1452987 Reviewed-by: heycam MozReview-Commit-ID: 5LRaaEPSSdY
This commit is contained in:
parent
9a900ef019
commit
1d8e64c8ee
1 changed files with 3 additions and 7 deletions
|
@ -56,14 +56,10 @@ impl CssUrl {
|
||||||
|
|
||||||
/// Convert from URLValueData to SpecifiedUrl.
|
/// Convert from URLValueData to SpecifiedUrl.
|
||||||
unsafe fn from_url_value_data(url: &URLValueData) -> Result<Self, ()> {
|
unsafe fn from_url_value_data(url: &URLValueData) -> Result<Self, ()> {
|
||||||
|
let arc_type =
|
||||||
|
&url.mString as *const _ as *const RawOffsetArc<String>;
|
||||||
Ok(CssUrl {
|
Ok(CssUrl {
|
||||||
serialization: if url.mUsingRustString {
|
serialization: Arc::from_raw_offset((*arc_type).clone()),
|
||||||
let arc_type =
|
|
||||||
url.mStrings.mRustString.as_ref() as *const _ as *const RawOffsetArc<String>;
|
|
||||||
Arc::from_raw_offset((*arc_type).clone())
|
|
||||||
} else {
|
|
||||||
Arc::new(url.mStrings.mString.as_ref().to_string())
|
|
||||||
},
|
|
||||||
extra_data: url.mExtraData.to_safe(),
|
extra_data: url.mExtraData.to_safe(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue