mirror of
https://github.com/servo/servo.git
synced 2025-08-15 18:35:33 +01:00
style: Use helper function to set length and copy into nsTArrays of PODs from Rust.
Differential Revision: https://phabricator.services.mozilla.com/D8058
This commit is contained in:
parent
d960db340c
commit
4e174ace3b
3 changed files with 40 additions and 55 deletions
|
@ -179,12 +179,7 @@ impl Parse for VectorValues {
|
|||
#[cfg(feature = "gecko")]
|
||||
impl ToGeckoFontFeatureValues for VectorValues {
|
||||
fn to_gecko_font_feature_values(&self, array: &mut nsTArray<u32>) {
|
||||
unsafe {
|
||||
array.set_len_pod(self.0.len() as u32);
|
||||
}
|
||||
for (dest, value) in array.iter_mut().zip(self.0.iter()) {
|
||||
*dest = *value;
|
||||
}
|
||||
array.assign_from_iter_pod(self.0.iter().map(|v| *v));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue