mirror of
https://github.com/servo/servo.git
synced 2025-08-10 16:05:43 +01:00
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:
parent
d4ad12bee4
commit
1e6338e1ee
4 changed files with 26 additions and 58 deletions
|
@ -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 }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue