bytecodealliance / bytecodealliance/wasm-tools
Add `From` implementations for structural types to `StructuralType`, `SubType` and `Type`
- Dominant language
- Rust
- Stars
- 1.8k
- Forks
- 351
- Avg merge
- 16h 57m
- Merged PRs (30d)
- 38
Description
Looking at all these conversions between `Type`, `SubType`, `StructuralType`, and each structural type variant, it seems like we could have some more `From` implementations to make this less noisy and more automatic.
To really benefit from this, and because `From` is not transitive by default, I think we would want all of these impls:
```rust
impl From for StructuralType { ... }
impl From for StructuralType { ... }
impl From for StructuralType { ... }
impl From for SubType { ... }
impl From for SubType { ... }
impl From for SubType { ... }
impl From for SubType { ... }
impl From for Type { ... }
impl From for Type { ... }
impl From for Type { ... }
impl From for Type { ... }
impl From for Type { ... }
```
_Originally posted by @fitzgen in https://github.com/bytecodealliance/wasm-tools/pull/1059#discussion_r1230108885_
Contributor guide
Assessment
This issue has not been assessed yet.