In Rust, tuples are a useful way to group multiple values together. However, when dealing with complex data or when readability and maintainability are priorities, creating specific structs is often a better choice. Remember we had the following method:
// Helper function to get the consistently ordered trading pairfn get_trading_pair(asset_a: AssetIdOf<T>,asset_b: AssetIdOf<T>,) -> (AssetIdOf<T>, AssetIdOf<T>) {if asset_a < asset_b {(asset_a, asset_b)} else {(asset_b, asset_a)}}
While this approach works, it has some drawbacks:
Try refactoring this code to create a specific struct for representing the trading pair
No files edited in this step.