mirror of
https://github.com/servo/servo.git
synced 2025-07-02 21:13:39 +01:00
Kill ComputedValueAsSpecified 🔫
This commit is contained in:
parent
891789109b
commit
4e64ccde60
2 changed files with 1 additions and 25 deletions
|
@ -312,26 +312,6 @@ impl<T> ToComputedValue for Box<[T]>
|
|||
}
|
||||
}
|
||||
|
||||
/// A marker trait to represent that the specified value is also the computed
|
||||
/// value.
|
||||
pub trait ComputedValueAsSpecified {}
|
||||
|
||||
impl<T> ToComputedValue for T
|
||||
where T: ComputedValueAsSpecified + Clone,
|
||||
{
|
||||
type ComputedValue = T;
|
||||
|
||||
#[inline]
|
||||
fn to_computed_value(&self, _context: &Context) -> T {
|
||||
self.clone()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn from_computed_value(computed: &T) -> Self {
|
||||
computed.clone()
|
||||
}
|
||||
}
|
||||
|
||||
trivial_to_computed_value!(());
|
||||
trivial_to_computed_value!(bool);
|
||||
trivial_to_computed_value!(f32);
|
||||
|
|
|
@ -34,11 +34,7 @@ pub enum Image<Gradient, MozImageRect, ImageUrl> {
|
|||
PaintWorklet(PaintWorklet),
|
||||
}
|
||||
|
||||
// Can't just use derive(ToComputedValue) on Image, because when trying to do
|
||||
// "impl<T> ToComputedValue for Box<T>" the Rust compiler complains that
|
||||
// "impl<T> ToComputedValue for T where T: ComputedValueAsSpecified + Clone"
|
||||
// aleady implements ToComputedValue for std::boxed::Box<_> and hence we have
|
||||
// conflicting implementations.
|
||||
// FIXME(nox): Implement TCV for Box<T> and derive this.
|
||||
impl<Gradient: ToComputedValue,
|
||||
MozImageRect: ToComputedValue,
|
||||
ImageUrl: ToComputedValue> ToComputedValue for Image<Gradient, MozImageRect, ImageUrl> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue