Skip to content

Commit cf7b7cd

Browse files
committed
Rust codegen: document reference printing
1 parent aaf556f commit cf7b7cd

File tree

1 file changed

+4
-3
lines changed
  • lambda-buffers-codegen/src/LambdaBuffers/Codegen/Rust/Print

1 file changed

+4
-3
lines changed

lambda-buffers-codegen/src/LambdaBuffers/Codegen/Rust/Print/LamVal.hs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,13 +320,14 @@ printCaseTextE iTyDefs txtVal cases otherCase = do
320320

321321
{- | Print a reference
322322
323+
HACK(szg251)
323324
To help Rust type inference, we inject type information for a few references.
324-
In case of a `toPlutusData`, `fromPlutusData`, `toJson`, `fromJson` we call the reference as a trait
325-
method on the target type:
325+
In case of trait methods and associated functions, such as `toPlutusData`, `fromPlutusData`,
326+
`toJson`, `fromJson` we call the reference as a trait method on the target type:
326327
```rs
327328
<TargetType>::to_plutus_data(...)
328329
```
329-
In case of `jsonConstructor`, we print the target type in a turbofish syntax:
330+
In case of functions with a generic argument, such as `jsonConstructor`, we print the target type in a turbofish syntax:
330331
```rs
331332
lbr_prelude::json::json_constructr::<TargetType>::toPlutusData(...)
332333
```

0 commit comments

Comments
 (0)