Commit b651986
fix(codegen): Convert string literals in tuples to owned Strings (Refs DEPYLER-0682)
Python tuple literals containing strings like [(1, "a"), (2, "b")] were
generating inconsistent Rust types - some elements had .to_string() and
others were raw &str literals. This caused type mismatch errors when the
tuples were used in Vec collections.
Changes:
- Updated convert_tuple() to apply .to_string() to string literals
- Ensures all string elements in tuples become owned Strings
- Maintains type consistency in Vec<(i32, i32, String)> patterns
Example transformation:
signs = [(1, 20, "Capricorn"), (2, 19, "Aquarius")]
Now consistently generates:
vec![(1, 20, "Capricorn".to_string()), (2, 19, "Aquarius".to_string())]
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent af99f41 commit b651986
1 file changed
+12
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13457 | 13457 | | |
13458 | 13458 | | |
13459 | 13459 | | |
| 13460 | + | |
| 13461 | + | |
| 13462 | + | |
| 13463 | + | |
13460 | 13464 | | |
13461 | 13465 | | |
13462 | | - | |
| 13466 | + | |
| 13467 | + | |
| 13468 | + | |
| 13469 | + | |
| 13470 | + | |
| 13471 | + | |
| 13472 | + | |
| 13473 | + | |
13463 | 13474 | | |
13464 | 13475 | | |
13465 | 13476 | | |
| |||
0 commit comments