style: Use Rust types for Position.

This one should be much easier to review / much more pleasant to see :-)

Differential Revision: https://phabricator.services.mozilla.com/D19563
This commit is contained in:
Emilio Cobos Álvarez 2019-02-12 21:45:29 +01:00
parent d4ad12bee4
commit 1e6338e1ee
4 changed files with 26 additions and 58 deletions

View file

@ -19,20 +19,20 @@
ToAnimatedZero,
ToComputedValue,
)]
pub struct Position<H, V> {
#[repr(C)]
pub struct GenericPosition<H, V> {
/// The horizontal component of position.
pub horizontal: H,
/// The vertical component of position.
pub vertical: V,
}
pub use self::GenericPosition as Position;
impl<H, V> Position<H, V> {
/// Returns a new position.
pub fn new(horizontal: H, vertical: V) -> Self {
Self {
horizontal: horizontal,
vertical: vertical,
}
Self { horizontal, vertical }
}
}