extern crate libc;
extern crate std;

use super::liblua;
use super::Lua;
use super::Pushable;

impl<T: Pushable> Pushable for Vec<T> {
    fn push_to_lua(&self, lua: &mut Lua) {
        self.as_slice().push_to_lua(lua)
    }
}

impl<'a, T: Pushable> Pushable for &'a [T] {
    fn push_to_lua(&self, lua: &mut Lua) {
        // creating empty table
        unsafe { liblua::lua_newtable(lua.lua) };

        for i in range(0, self.len()) {
            (i+1).push_to_lua(lua);
            self[i].push_to_lua(lua);
            unsafe { liblua::lua_settable(lua.lua, -3) };
        }
    }
}

#[cfg(test)]
mod tests {
    #[test]
    fn write() {
        let mut lua = super::super::Lua::new();

        lua.set("a", vec!(9, 8, 7)).unwrap();

        // TODO: test if it worked once reading tables is supported
    }
}

extern crate libc;
extern crate std;

use super::liblua;
use super::Index;
use super::Lua;
use super::Pushable;
use super::Readable;

impl<T:Pushable> Pushable for Vec<T> {
    fn push_to_lua(&self, lua: &mut Lua) {
        unimplemented!()
    }
}

--- 
+++ 
@@ -2,36 +2,13 @@
 extern crate std;
 
 use super::liblua;
+use super::Index;
 use super::Lua;
 use super::Pushable;
+use super::Readable;
 
-impl<T: Pushable> Pushable for Vec<T> {
+impl<T:Pushable> Pushable for Vec<T> {
     fn push_to_lua(&self, lua: &mut Lua) {
-        self.as_slice().push_to_lua(lua)
+        unimplemented!()
     }
 }
-
-impl<'a, T: Pushable> Pushable for &'a [T] {
-    fn push_to_lua(&self, lua: &mut Lua) {
-        // creating empty table
-        unsafe { liblua::lua_newtable(lua.lua) };
-
-        for i in range(0, self.len()) {
-            (i+1).push_to_lua(lua);
-            self[i].push_to_lua(lua);
-            unsafe { liblua::lua_settable(lua.lua, -3) };
-        }
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    #[test]
-    fn write() {
-        let mut lua = super::super::Lua::new();
-
-        lua.set("a", vec!(9, 8, 7)).unwrap();
-
-        // TODO: test if it worked once reading tables is supported
-    }
-}
Implement pushable for vectors and slices
