Skip to content

Commit 76af155

Browse files
committed
Use tuple unpacking in for loop
1 parent 9dc68e6 commit 76af155

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,9 @@ mod rustfluent {
8989
let mut args = FluentArgs::new();
9090

9191
if let Some(variables) = variables {
92-
for variable in variables {
92+
for (python_key, python_value) in variables {
9393
// Make sure the variable key is a Python string,
9494
// raising a TypeError if not.
95-
let python_key = variable.0;
9695
if !python_key.is_instance_of::<PyString>() {
9796
return Err(PyTypeError::new_err(format!(
9897
"Variable key not a str, got {python_key}."
@@ -101,7 +100,6 @@ mod rustfluent {
101100
let key = python_key.to_string();
102101
// Set the variable value as a string or integer,
103102
// raising a TypeError if not.
104-
let python_value = variable.1;
105103
if python_value.is_instance_of::<PyString>() {
106104
args.set(key, python_value.to_string());
107105
} else if python_value.is_instance_of::<PyInt>() {

0 commit comments

Comments
 (0)