forked from mirrors/gecko-dev
- Added `--enable-uniffi-fixtures` flag. When set, we will compile in the UniFFI test fixtures into our shared Rust crate and eventually into `libxul`. - Vendoring in the Rust crates needed for `uniffi-bindgen-gecko-js` Differential Revision: https://phabricator.services.mozilla.com/D144467
15 lines
197 B
Rust
15 lines
197 B
Rust
use extend::ext;
|
|
|
|
#[ext]
|
|
impl<'a, T: Clone> Vec<&'a T>
|
|
where
|
|
T: 'a + Copy,
|
|
{
|
|
fn size(&self) -> usize {
|
|
self.len()
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
assert_eq!(3, vec![&1, &2, &3].size());
|
|
}
|