mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Make most background- properties handle arrays
This commit is contained in:
parent
ce9640a48e
commit
65a8a8dccb
4 changed files with 72 additions and 67 deletions
|
@ -3,13 +3,16 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use std::iter::{once, Chain, Once, IntoIterator};
|
||||
use std::slice::IterMut;
|
||||
use std::slice::{Iter, IterMut};
|
||||
use structs::nsStyleAutoArray;
|
||||
|
||||
impl<T> nsStyleAutoArray<T> {
|
||||
pub fn iter_mut(&mut self) -> Chain<Once<&mut T>, IterMut<T>> {
|
||||
once(&mut self.mFirstElement).chain(self.mOtherElements.iter_mut())
|
||||
}
|
||||
pub fn iter(&self) -> Chain<Once<&T>, Iter<T>> {
|
||||
once(&self.mFirstElement).chain(self.mOtherElements.iter())
|
||||
}
|
||||
|
||||
// Note that often structs containing autoarrays will have
|
||||
// additional member fields that contain the length, which must be kept
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue