diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2018-01-22 21:49:18 +0100 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2018-01-23 00:57:54 +0100 |
commit | 5ac12b5df4406dbde1ceeb6be36be5c3162401a2 (patch) | |
tree | 173742ffb60360fc56f39a5b05b53890e84853ee /components/script_layout_interface/lib.rs | |
parent | 6f543d3de1658e3cacf7fc2caed7b9bda69e1d23 (diff) | |
download | servo-5ac12b5df4406dbde1ceeb6be36be5c3162401a2.tar.gz servo-5ac12b5df4406dbde1ceeb6be36be5c3162401a2.zip |
style: Make the TElement type arrive to the `cascade` function.
Not super-proud of this one, but it's the easiest way I could think of.
The changeset looks bigger than what it is, because while at it I've rewrapped a
fair amount of functions around to use proper block indentation.
Alternatives are parameterizing Stylist by <E>, which is not fun, or moving the
concrete element from layout_thread to layout, but that implies layout depending
on script, which isn't fun either.
Other alternative is implementing an empty enum and making anon boxes work on
it. It has the advantage of removing the annoying type parameter, but the
disadvantage of instantiating `cascade` twice, which isn't great, and having to
maintain all the boilerplate of a `TElement` implementation that just does
nothing.
Diffstat (limited to 'components/script_layout_interface/lib.rs')
-rw-r--r-- | components/script_layout_interface/lib.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/components/script_layout_interface/lib.rs b/components/script_layout_interface/lib.rs index 0538aabafd0..45c82ee1089 100644 --- a/components/script_layout_interface/lib.rs +++ b/components/script_layout_interface/lib.rs @@ -7,6 +7,7 @@ //! to depend on script. #![deny(unsafe_code)] +#![feature(associated_type_defaults)] extern crate app_units; extern crate atomic_refcell; |