From 63e0587d2665fd2abc732f0c55e89868f3a8a2d4 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Mon, 24 Jul 2017 23:52:15 +0200 Subject: [PATCH] Remove "equivalent" Lua code from Function::bind Not only was this code not equivalent, it didn't even run since varargs cannot be used as an upvalue (it's multiple values, after all). Since Lua does not allow passing 2 sets of variadic arguments to a function, the resulting code would be *very* complex and would involve packing both sets of varargs into tables, concatenating them, then `table.unpack`ing them to finally pass them. This complex code would only make the docs more difficult to understand, which is the opposite effect I originally intended with this. Let's just get rid of this bad equivalence. --- src/lua.rs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/lua.rs b/src/lua.rs index 7e8d896..148c3d9 100644 --- a/src/lua.rs +++ b/src/lua.rs @@ -501,14 +501,6 @@ impl<'lua> Function<'lua> { /// Returns a function that, when called with no arguments, calls `self`, passing `args` as /// arguments. /// - /// This is equivalent to this Lua code: - /// - /// ```notrust - /// function bind(f, ...) - /// return function() f(...) end - /// end - /// ``` - /// /// # Example /// /// ```