Commit 6e9c3eb
Use macro for tuple conversion support up to 12-tuple
Replace manually written From implementations for tuples with a macro-based
approach (impl_tuple_from!) that generates all necessary implementations for
tuples of sizes 2 through 12, following Rust's standard library convention.
Changes:
- Replace 12 manual impl From blocks with macro-generated implementations
- Support 4 conversion types for each tuple size:
- All &str: first becomes ID, rest become values
- All String: same pattern with owned strings
- &str ID with LiNo values: for nested link structures
- All LiNo: creates anonymous links (no ID)
- Add 16 new tests for tuple sizes 5-12
- Update README documentation with new tuple size support
This reduces code duplication while providing compile-time type safety
for all supported tuple sizes.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 1fd66fb commit 6e9c3eb
File tree
3 files changed
+879
-128
lines changed- rust/links-notation
- src
- tests
3 files changed
+879
-128
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
301 | 326 | | |
302 | 327 | | |
303 | 328 | | |
| |||
0 commit comments