File tree Expand file tree Collapse file tree 4 files changed +12
-10
lines changed
contracts/ibc-reflect/examples Expand file tree Collapse file tree 4 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -196,6 +196,8 @@ and this project adheres to
196196 ` StakingQuery::Validator ` , ` ValidatorResponse ` and
197197 ` QuerierWrapper::query_validator ` to allow querying a single validator.
198198 ([ #879 ] )
199+ - cosmwasm-schema: Make first argument non-mutable in ` export_schema_with_title `
200+ for consistency with ` export_schema ` .
199201
200202[ #696 ] : https://github.com/CosmWasm/cosmwasm/issues/696
201203[ #697 ] : https://github.com/CosmWasm/cosmwasm/issues/697
Original file line number Diff line number Diff line change @@ -18,17 +18,17 @@ fn main() {
1818 export_schema ( & schema_for ! ( QueryMsg ) , & out_dir) ;
1919 export_schema ( & schema_for ! ( PacketMsg ) , & out_dir) ;
2020 export_schema_with_title (
21- & mut schema_for ! ( AcknowledgementMsg <BalancesResponse >) ,
21+ & schema_for ! ( AcknowledgementMsg <BalancesResponse >) ,
2222 & out_dir,
2323 "AcknowledgementMsgBalances" ,
2424 ) ;
2525 export_schema_with_title (
26- & mut schema_for ! ( AcknowledgementMsg <DispatchResponse >) ,
26+ & schema_for ! ( AcknowledgementMsg <DispatchResponse >) ,
2727 & out_dir,
2828 "AcknowledgementMsgDispatch" ,
2929 ) ;
3030 export_schema_with_title (
31- & mut schema_for ! ( AcknowledgementMsg <WhoAmIResponse >) ,
31+ & schema_for ! ( AcknowledgementMsg <WhoAmIResponse >) ,
3232 & out_dir,
3333 "AcknowledgementMsgWhoAmI" ,
3434 ) ;
Original file line number Diff line number Diff line change @@ -20,13 +20,13 @@ pub fn export_schema(schema: &RootSchema, out_dir: &Path) {
2020
2121// use this if you want to override the auto-detected name of the object.
2222// very useful when creating an alias for a type-alias.
23- pub fn export_schema_with_title ( schema : & mut RootSchema , out_dir : & Path , title : & str ) {
24- // set the title explicitly on the schemas metadata
25- let metadata = & mut schema. schema . metadata ;
26- if let Some ( data ) = metadata {
27- data . title = Some ( title. to_string ( ) ) ;
23+ pub fn export_schema_with_title ( schema : & RootSchema , out_dir : & Path , title : & str ) {
24+ let mut schema = schema . clone ( ) ;
25+ // set the title explicitly on the schema's metadata
26+ if let Some ( metadata ) = & mut schema . schema . metadata {
27+ metadata . title = Some ( title. to_string ( ) ) ;
2828 }
29- write_schema ( schema, out_dir, & title) ;
29+ write_schema ( & schema, out_dir, & title) ;
3030}
3131
3232/// Writes schema to file. Overwrites existing file.
Original file line number Diff line number Diff line change @@ -11,5 +11,5 @@ fn main() {
1111 remove_schemas ( & out_dir) . unwrap ( ) ;
1212
1313 export_schema ( & schema_for ! ( Timestamp ) , & out_dir) ;
14- export_schema_with_title ( & mut schema_for ! ( CosmosMsg ) , & out_dir, "CosmosMsg" ) ;
14+ export_schema_with_title ( & schema_for ! ( CosmosMsg ) , & out_dir, "CosmosMsg" ) ;
1515}
You can’t perform that action at this time.
0 commit comments