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.
This commit is contained in:
Jonas Schievink 2017-07-24 23:52:15 +02:00
parent 9b809a8197
commit 63e0587d26
1 changed files with 0 additions and 8 deletions

View File

@ -501,14 +501,6 @@ impl<'lua> Function<'lua> {
/// Returns a function that, when called with no arguments, calls `self`, passing `args` as /// Returns a function that, when called with no arguments, calls `self`, passing `args` as
/// arguments. /// arguments.
/// ///
/// This is equivalent to this Lua code:
///
/// ```notrust
/// function bind(f, ...)
/// return function() f(...) end
/// end
/// ```
///
/// # Example /// # Example
/// ///
/// ``` /// ```