Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some small changes to get Servo compiling #152

Merged
merged 1 commit into from Aug 10, 2016
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -1,6 +1,6 @@
[package]
name = "euclid"
version = "0.8.0"
version = "0.8.1"
authors = ["The Servo Project Developers"]
description = "Geometry primitives"
documentation = "http://doc.servo.org/euclid/"
@@ -20,7 +20,7 @@ use std::ops::{AddAssign, SubAssign};
use std::marker::PhantomData;
use std::fmt;

#[derive(RustcDecodable, RustcEncodable)]
#[derive(Clone, Copy, RustcDecodable, RustcEncodable)]
pub struct UnknownUnit;

/// A one-dimensional distance, with value represented by `T` and unit of measurement `Unit`.
@@ -36,7 +36,7 @@ pub struct UnknownUnit;
/// another. See the `ScaleFactor` docs for an example.
// Uncomment the derive, and remove the macro call, once heapsize gets
// PhantomData<T> support.
#[derive(RustcDecodable, RustcEncodable)]
#[derive(Clone, Copy, RustcDecodable, RustcEncodable)]
pub struct Length<T, Unit>(pub T, PhantomData<Unit>);

impl<Unit, T: HeapSizeOf> HeapSizeOf for Length<T, Unit> {
@@ -64,8 +64,6 @@ impl<T, Unit> Length<T, Unit> {
}
}

impl<T: Copy, Unit> Copy for Length<T, Unit> {}

impl<Unit, T: Clone> Length<T, Unit> {
pub fn get(&self) -> T {
self.0.clone()
@@ -157,15 +155,6 @@ impl<Unit, T0: NumCast + Clone> Length<T0, Unit> {
}
}

// FIXME: Switch to `derive(Clone, PartialEq, PartialOrd, Zero)` after this Rust issue is fixed:
// https://github.com/mozilla/rust/issues/7671

impl<Unit, T: Clone> Clone for Length<T, Unit> {
fn clone(&self) -> Length<T, Unit> {
Length::new(self.get())
}
}

impl<Unit, T: Clone + PartialEq> PartialEq for Length<T, Unit> {
fn eq(&self, other: &Length<T, Unit>) -> bool { self.get().eq(&other.get()) }
}
@@ -16,6 +16,7 @@ use std::ops::{Add, Mul, Sub};
use std::marker::PhantomData;

define_matrix! {
#[derive(Clone, Copy, Eq, Hash, PartialEq)]
pub struct TypedMatrix2D<T, Src, Dst> {
pub m11: T, pub m12: T,
pub m21: T, pub m22: T,
@@ -21,7 +21,7 @@ use heapsize::HeapSizeOf;
/// A group of side offsets, which correspond to top/left/bottom/right for borders, padding,
/// and margins in CSS.
define_vector! {
#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct TypedSideOffsets2D<T, U> {
pub top: T,
pub right: T,
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.