Generate From<> rust conversions when the encoding is infallible
Open
- Dominant language
- Rust
- Stars
- 86
- Forks
- 18
- Avg merge
- 20h 49m
- Merged PRs (30d)
- 1
Description
When converting from a child packet to a parent the encoding is often infallible, but the rust backend still generates TryFrom<> implementations instead of From<>.
For example:
```
packet Command {
op_code: 8,
_size_(_payload_),
_payload_,
}
packet OneCommand : Command (op_code = 1) {
x: 16,
y: 16,
}
```
Generates
```
impl TryFrom for Command {}
```
When the conversion can never fail.
Contributor guide
Assessment
This issue has not been assessed yet.