File tree 4 files changed +12
-10
lines changed
contracts/ibc-reflect/examples
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
196
196
` StakingQuery::Validator ` , ` ValidatorResponse ` and
197
197
` QuerierWrapper::query_validator ` to allow querying a single validator.
198
198
([ #879 ] )
199
+ - cosmwasm-schema: Make first argument non-mutable in ` export_schema_with_title `
200
+ for consistency with ` export_schema ` .
199
201
200
202
[ #696 ] : https://github.com/CosmWasm/cosmwasm/issues/696
201
203
[ #697 ] : https://github.com/CosmWasm/cosmwasm/issues/697
Original file line number Diff line number Diff line change @@ -18,17 +18,17 @@ fn main() {
18
18
export_schema ( & schema_for ! ( QueryMsg ) , & out_dir) ;
19
19
export_schema ( & schema_for ! ( PacketMsg ) , & out_dir) ;
20
20
export_schema_with_title (
21
- & mut schema_for ! ( AcknowledgementMsg <BalancesResponse >) ,
21
+ & schema_for ! ( AcknowledgementMsg <BalancesResponse >) ,
22
22
& out_dir,
23
23
"AcknowledgementMsgBalances" ,
24
24
) ;
25
25
export_schema_with_title (
26
- & mut schema_for ! ( AcknowledgementMsg <DispatchResponse >) ,
26
+ & schema_for ! ( AcknowledgementMsg <DispatchResponse >) ,
27
27
& out_dir,
28
28
"AcknowledgementMsgDispatch" ,
29
29
) ;
30
30
export_schema_with_title (
31
- & mut schema_for ! ( AcknowledgementMsg <WhoAmIResponse >) ,
31
+ & schema_for ! ( AcknowledgementMsg <WhoAmIResponse >) ,
32
32
& out_dir,
33
33
"AcknowledgementMsgWhoAmI" ,
34
34
) ;
Original file line number Diff line number Diff line change @@ -20,13 +20,13 @@ pub fn export_schema(schema: &RootSchema, out_dir: &Path) {
20
20
21
21
// use this if you want to override the auto-detected name of the object.
22
22
// 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 ( ) ) ;
28
28
}
29
- write_schema ( schema, out_dir, & title) ;
29
+ write_schema ( & schema, out_dir, & title) ;
30
30
}
31
31
32
32
/// Writes schema to file. Overwrites existing file.
Original file line number Diff line number Diff line change @@ -11,5 +11,5 @@ fn main() {
11
11
remove_schemas ( & out_dir) . unwrap ( ) ;
12
12
13
13
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" ) ;
15
15
}
You can’t perform that action at this time.
0 commit comments