use std::cmp::Ordering;
use std::hash::{Hash, Hasher};
use uuid::Uuid;

pub trait JsTrait {}

pub struct JsT {
    uid: Uuid,
    t: Box<JsTrait>,
}

impl JsT {
    pub fn new(t: Box<JsTrait>) -> JsT {
        JsT {
            uid: Uuid::new_v4(),
            t: t,
        }
    }
}

impl PartialEq for JsT {
    fn eq(&self, other: &Self) -> bool {
        self.uid == other.uid
    }

    fn ne(&self, other: &Self) -> bool {
        !self.eq(other)
    }
}

impl Eq for JsT {}

impl Hash for JsT {
    fn hash<H>(&self, state: &mut H) where H: Hasher {
        self.uid.hash(state);
    }

    fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher {
        for ref d in data {
            d.uid.hash(state);
        }
    }
}


use std::cmp::Ordering;
use std::hash::{Hash, Hasher};
use uuid::Uuid;

pub struct JsType {
    uid: Uuid,
    t: Box<JsT>,
}

impl JsType {
    fn new(t: Box<JsT>) -> JsType {
        JsType {
            uid: Uuid::new_v4(),
            t: t,
        }
    }
}

impl PartialEq for JsType {
    fn eq(&self, other: &Self) -> bool {
        self.uid == other.uid
    }

    fn ne(&self, other: &Self) -> bool {
        !self.eq(other)
    }
}

impl Eq for JsType{}

impl Hash for JsType {
    fn hash<H>(&self, state: &mut H) where H: Hasher {
        self.uid.hash(state);
    }

    fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher {
        for ref d in data {
            d.uid.hash(state);
        }
    }
}

pub trait JsT {}

--- 
+++ 
@@ -2,21 +2,23 @@
 use std::hash::{Hash, Hasher};
 use uuid::Uuid;
 
-pub struct JsType {
+pub trait JsTrait {}
+
+pub struct JsT {
     uid: Uuid,
-    t: Box<JsT>,
+    t: Box<JsTrait>,
 }
 
-impl JsType {
-    fn new(t: Box<JsT>) -> JsType {
-        JsType {
+impl JsT {
+    pub fn new(t: Box<JsTrait>) -> JsT {
+        JsT {
             uid: Uuid::new_v4(),
             t: t,
         }
     }
 }
 
-impl PartialEq for JsType {
+impl PartialEq for JsT {
     fn eq(&self, other: &Self) -> bool {
         self.uid == other.uid
     }
@@ -26,9 +28,9 @@
     }
 }
 
-impl Eq for JsType{}
+impl Eq for JsT {}
 
-impl Hash for JsType {
+impl Hash for JsT {
     fn hash<H>(&self, state: &mut H) where H: Hasher {
         self.uid.hash(state);
     }
@@ -40,4 +42,3 @@
     }
 }
 
-pub trait JsT {}
Rename JsType to JsT, JsT to JsTrait
