You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, it would be kinda troublesome to use IndexedMap because we need to manually implement IndexList for every struct that we want to use as the index.
Rust's procedural macro feature enabled us to easily provide 1 line of code instead of manually typing the impl by ourselves for every struct we created.
Implementing this and reexport it in cw-storage-plus package (may be in an additional cfg features) will makes dev life much easier
Proposal: reduce this,
#[derive(Serialize,Deserialize,Clone,Debug,PartialEq,JsonSchema)]pubstructToken{pubowner:Addr,pubticker:String,pubidentifier:u8,// <---- unique value}pubstructTokenIndexes<'a>{pubidentifier:UniqueIndex<'a,U8Key,Token>,}// IndexList is just boilerplate code for fetching a struct's indexesimpl<'a>IndexList<Token>forTokenIndexes<'a>{fnget_indexes(&'_self) -> Box<dynIterator<Item=&'_dynIndex<Token>> + '_>{let v:Vec<&dynIndex<Token>> = vec![&self.identifier];Box::new(v.into_iter())}}
Currently, it would be kinda troublesome to use
IndexedMap
because we need to manually implementIndexList
for every struct that we want to use as the index.Rust's procedural macro feature enabled us to easily provide 1 line of code instead of manually typing the impl by ourselves for every struct we created.
Implementing this and reexport it in
cw-storage-plus
package (may be in an additional cfg features) will makes dev life much easierProposal: reduce this,
to this
The text was updated successfully, but these errors were encountered: