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