mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #14370 - thiagopnts:master, r=Wafflespeanut
use Either type for UrlOrNone Use the Either type for UrlOrNone --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #14298 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14370) <!-- Reviewable:end -->
This commit is contained in:
commit
290ff5c801
9 changed files with 30 additions and 49 deletions
|
@ -1089,10 +1089,10 @@ fn static_assert() {
|
|||
|
||||
#[allow(non_snake_case)]
|
||||
pub fn set__moz_binding(&mut self, v: longhands::_moz_binding::computed_value::T) {
|
||||
use properties::longhands::_moz_binding::computed_value::T as BindingValue;
|
||||
use values::Either;
|
||||
match v {
|
||||
BindingValue::None => debug_assert!(self.gecko.mBinding.mRawPtr.is_null()),
|
||||
BindingValue::Url(ref url) => {
|
||||
Either::Second(_none) => debug_assert!(self.gecko.mBinding.mRawPtr.is_null()),
|
||||
Either::First(ref url) => {
|
||||
let extra_data = url.extra_data();
|
||||
let (ptr, len) = url.as_slice_components();
|
||||
unsafe {
|
||||
|
@ -1617,14 +1617,14 @@ fn static_assert() {
|
|||
skip_additionals="*">
|
||||
|
||||
pub fn set_list_style_image(&mut self, image: longhands::list_style_image::computed_value::T) {
|
||||
use values::computed::UrlOrNone;
|
||||
use values::Either;
|
||||
match image {
|
||||
UrlOrNone::None => {
|
||||
Either::Second(_none) => {
|
||||
unsafe {
|
||||
Gecko_SetListStyleImageNone(&mut self.gecko);
|
||||
}
|
||||
}
|
||||
UrlOrNone::Url(ref url) => {
|
||||
Either::First(ref url) => {
|
||||
let (ptr, len) = url.as_slice_components();
|
||||
let extra_data = url.extra_data();
|
||||
unsafe {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue