SpacetimeDB
SpacetimeDB copied to clipboard
Track typescript import statements in a btree to deduplicate them
Description of Changes
When generating TS code, this tracks import statements in a set instead of a vector to avoid duplicates. With the previous code, you could have duplicate import statements if there are two enum cases with field types that require an import.
API and ABI breaking changes
None.
Expected complexity level and risk
- This is very simple and low risk.
Testing
This fixed an issue I had with this type:
#[derive(Debug, Clone, Copy, SpacetimeType, Hash, Eq, PartialEq)]
enum Role {
Spectator,
Player(Team),
Spymaster(Team),
}
Previously the import for Team would get generated twice.
- [x] Worked for previously failing example.