Skip to content

Commit c086c14

Browse files
committed
Use impl IntoIterator in Lua::create_table_from/create_sequence_from
1 parent 640cb2c commit c086c14

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/state.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,11 +1030,10 @@ impl Lua {
10301030
}
10311031

10321032
/// Creates a table and fills it with values from an iterator.
1033-
pub fn create_table_from<K, V, I>(&self, iter: I) -> Result<Table>
1033+
pub fn create_table_from<K, V>(&self, iter: impl IntoIterator<Item = (K, V)>) -> Result<Table>
10341034
where
10351035
K: IntoLua,
10361036
V: IntoLua,
1037-
I: IntoIterator<Item = (K, V)>,
10381037
{
10391038
let lua = self.lock();
10401039
let state = lua.state();
@@ -1061,10 +1060,9 @@ impl Lua {
10611060
}
10621061

10631062
/// Creates a table from an iterator of values, using `1..` as the keys.
1064-
pub fn create_sequence_from<T, I>(&self, iter: I) -> Result<Table>
1063+
pub fn create_sequence_from<T>(&self, iter: impl IntoIterator<Item = T>) -> Result<Table>
10651064
where
10661065
T: IntoLua,
1067-
I: IntoIterator<Item = T>,
10681066
{
10691067
unsafe { self.lock().create_sequence_from(iter) }
10701068
}

0 commit comments

Comments
 (0)