Skip to content

Commit 07a5964

Browse files
committed
Remove unused result and error types
1 parent 17558f3 commit 07a5964

File tree

4 files changed

+53
-81
lines changed

4 files changed

+53
-81
lines changed

packages/schema-derive/src/generate_api.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,10 @@ impl Options {
201201
option_dispatch!(self.query_ty, |ty| {
202202
match backend {
203203
SchemaBackend::CwSchema => {
204-
quote! { <#ty as #crate_name::QueryResponses>::response_schemas_cw().unwrap() }
204+
quote! { <#ty as #crate_name::QueryResponses>::response_schemas_cw() }
205205
}
206206
SchemaBackend::JsonSchema => {
207-
quote! { <#ty as #crate_name::QueryResponses>::response_schemas().unwrap() }
207+
quote! { <#ty as #crate_name::QueryResponses>::response_schemas() }
208208
}
209209
}
210210
})

packages/schema-derive/src/query_responses.rs

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ pub fn query_responses_derive_impl(input: ItemEnum) -> syn::Result<ItemImpl> {
3939
#[automatically_derived]
4040
#[cfg(not(target_arch = "wasm32"))]
4141
impl #impl_generics #crate_name::QueryResponses for #ident #type_generics #where_clause {
42-
fn response_schemas_impl() -> ::std::collections::BTreeMap<String, #crate_name::schemars::schema::RootSchema> {
42+
fn response_schemas() -> ::std::collections::BTreeMap<String, #crate_name::schemars::schema::RootSchema> {
4343
let subqueries = [
4444
#( #subquery_calls, )*
4545
];
4646
#crate_name::combine_subqueries::<#subquery_len, #ident #type_generics, _>(subqueries)
4747
}
4848

49-
fn response_schemas_cw_impl() -> ::std::collections::BTreeMap<String, #crate_name::cw_schema::Schema> {
49+
fn response_schemas_cw() -> ::std::collections::BTreeMap<String, #crate_name::cw_schema::Schema> {
5050
let subqueries = [
5151
#( #subquery_calls_cw, )*
5252
];
@@ -81,13 +81,13 @@ pub fn query_responses_derive_impl(input: ItemEnum) -> syn::Result<ItemImpl> {
8181
#[automatically_derived]
8282
#[cfg(not(target_arch = "wasm32"))]
8383
impl #impl_generics #crate_name::QueryResponses for #ident #type_generics #where_clause {
84-
fn response_schemas_impl() -> ::std::collections::BTreeMap<String, #crate_name::schemars::schema::RootSchema> {
84+
fn response_schemas() -> ::std::collections::BTreeMap<String, #crate_name::schemars::schema::RootSchema> {
8585
::std::collections::BTreeMap::from([
8686
#( #mappings, )*
8787
])
8888
}
8989

90-
fn response_schemas_cw_impl() -> ::std::collections::BTreeMap<String, #crate_name::cw_schema::Schema> {
90+
fn response_schemas_cw() -> ::std::collections::BTreeMap<String, #crate_name::cw_schema::Schema> {
9191
::std::collections::BTreeMap::from([
9292
#( #cw_mappings, )*
9393
])
@@ -167,10 +167,10 @@ fn parse_subquery(ctx: &Context, v: &Variant, schema_backend: SchemaBackend) ->
167167

168168
let return_val = match schema_backend {
169169
SchemaBackend::CwSchema => {
170-
parse_quote!(<#submsg as #crate_name::QueryResponses>::response_schemas_cw_impl())
170+
parse_quote!(<#submsg as #crate_name::QueryResponses>::response_schemas_cw())
171171
}
172172
SchemaBackend::JsonSchema => {
173-
parse_quote!(<#submsg as #crate_name::QueryResponses>::response_schemas_impl())
173+
parse_quote!(<#submsg as #crate_name::QueryResponses>::response_schemas())
174174
}
175175
};
176176

@@ -231,14 +231,14 @@ mod tests {
231231
#[automatically_derived]
232232
#[cfg(not(target_arch = "wasm32"))]
233233
impl ::my_crate::cw_schema::QueryResponses for QueryMsg {
234-
fn response_schemas_impl() -> ::std::collections::BTreeMap<String, ::my_crate::cw_schema::schemars::schema::RootSchema> {
234+
fn response_schemas() -> ::std::collections::BTreeMap<String, ::my_crate::cw_schema::schemars::schema::RootSchema> {
235235
::std::collections::BTreeMap::from([
236236
("supply".to_string(), ::my_crate::cw_schema::schema_for!(some_crate::AnotherType)),
237237
("balance".to_string(), ::my_crate::cw_schema::schema_for!(SomeType)),
238238
])
239239
}
240240

241-
fn response_schemas_cw_impl() -> ::std::collections::BTreeMap<String, ::my_crate::cw_schema::cw_schema::Schema> {
241+
fn response_schemas_cw() -> ::std::collections::BTreeMap<String, ::my_crate::cw_schema::cw_schema::Schema> {
242242
::std::collections::BTreeMap::from([
243243
("supply".to_string(), ::my_crate::cw_schema::cw_schema::schema_of::<some_crate::AnotherType>()),
244244
("balance".to_string(), ::my_crate::cw_schema::cw_schema::schema_of::<SomeType>()),
@@ -268,20 +268,20 @@ mod tests {
268268
#[automatically_derived]
269269
#[cfg(not(target_arch = "wasm32"))]
270270
impl ::my_crate::cw_schema::QueryResponses for ContractQueryMsg {
271-
fn response_schemas_impl() -> ::std::collections::BTreeMap<String, ::my_crate::cw_schema::schemars::schema::RootSchema> {
271+
fn response_schemas() -> ::std::collections::BTreeMap<String, ::my_crate::cw_schema::schemars::schema::RootSchema> {
272272
let subqueries = [
273-
<QueryMsg1 as ::my_crate::cw_schema::QueryResponses>::response_schemas_impl(),
274-
<whitelist::QueryMsg as ::my_crate::cw_schema::QueryResponses>::response_schemas_impl(),
275-
<QueryMsg as ::my_crate::cw_schema::QueryResponses>::response_schemas_impl(),
273+
<QueryMsg1 as ::my_crate::cw_schema::QueryResponses>::response_schemas(),
274+
<whitelist::QueryMsg as ::my_crate::cw_schema::QueryResponses>::response_schemas(),
275+
<QueryMsg as ::my_crate::cw_schema::QueryResponses>::response_schemas(),
276276
];
277277
::my_crate::cw_schema::combine_subqueries::<3usize, ContractQueryMsg, _>(subqueries)
278278
}
279279

280-
fn response_schemas_cw_impl() -> ::std::collections::BTreeMap<String, ::my_crate::cw_schema::cw_schema::Schema> {
280+
fn response_schemas_cw() -> ::std::collections::BTreeMap<String, ::my_crate::cw_schema::cw_schema::Schema> {
281281
let subqueries = [
282-
<QueryMsg1 as ::my_crate::cw_schema::QueryResponses>::response_schemas_cw_impl(),
283-
<whitelist::QueryMsg as ::my_crate::cw_schema::QueryResponses>::response_schemas_cw_impl(),
284-
<QueryMsg as ::my_crate::cw_schema::QueryResponses>::response_schemas_cw_impl(),
282+
<QueryMsg1 as ::my_crate::cw_schema::QueryResponses>::response_schemas_cw(),
283+
<whitelist::QueryMsg as ::my_crate::cw_schema::QueryResponses>::response_schemas_cw(),
284+
<QueryMsg as ::my_crate::cw_schema::QueryResponses>::response_schemas_cw(),
285285
];
286286
::my_crate::cw_schema::combine_subqueries::<3usize, ContractQueryMsg, _>(subqueries)
287287
}
@@ -309,14 +309,14 @@ mod tests {
309309
#[automatically_derived]
310310
#[cfg(not(target_arch = "wasm32"))]
311311
impl ::cosmwasm_schema::QueryResponses for QueryMsg {
312-
fn response_schemas_impl() -> ::std::collections::BTreeMap<String, ::cosmwasm_schema::schemars::schema::RootSchema> {
312+
fn response_schemas() -> ::std::collections::BTreeMap<String, ::cosmwasm_schema::schemars::schema::RootSchema> {
313313
::std::collections::BTreeMap::from([
314314
("supply".to_string(), ::cosmwasm_schema::schema_for!(some_crate::AnotherType)),
315315
("balance".to_string(), ::cosmwasm_schema::schema_for!(SomeType)),
316316
])
317317
}
318318

319-
fn response_schemas_cw_impl() -> ::std::collections::BTreeMap<String, ::cosmwasm_schema::cw_schema::Schema> {
319+
fn response_schemas_cw() -> ::std::collections::BTreeMap<String, ::cosmwasm_schema::cw_schema::Schema> {
320320
::std::collections::BTreeMap::from([
321321
("supply".to_string(), ::cosmwasm_schema::cw_schema::schema_of::<some_crate::AnotherType>()),
322322
("balance".to_string(), ::cosmwasm_schema::cw_schema::schema_of::<SomeType>()),
@@ -341,11 +341,11 @@ mod tests {
341341
#[automatically_derived]
342342
#[cfg(not(target_arch = "wasm32"))]
343343
impl ::cosmwasm_schema::QueryResponses for QueryMsg {
344-
fn response_schemas_impl() -> ::std::collections::BTreeMap<String, ::cosmwasm_schema::schemars::schema::RootSchema> {
344+
fn response_schemas() -> ::std::collections::BTreeMap<String, ::cosmwasm_schema::schemars::schema::RootSchema> {
345345
::std::collections::BTreeMap::from([])
346346
}
347347

348-
fn response_schemas_cw_impl() -> ::std::collections::BTreeMap<String, ::cosmwasm_schema::cw_schema::Schema> {
348+
fn response_schemas_cw() -> ::std::collections::BTreeMap<String, ::cosmwasm_schema::cw_schema::Schema> {
349349
::std::collections::BTreeMap::from([])
350350
}
351351
}
@@ -398,14 +398,14 @@ mod tests {
398398
#[automatically_derived]
399399
#[cfg(not(target_arch = "wasm32"))]
400400
impl<T: ::cosmwasm_schema::schemars::JsonSchema + ::cosmwasm_schema::cw_schema::Schemaifier> ::cosmwasm_schema::QueryResponses for QueryMsg<T> {
401-
fn response_schemas_impl() -> ::std::collections::BTreeMap<String, ::cosmwasm_schema::schemars::schema::RootSchema> {
401+
fn response_schemas() -> ::std::collections::BTreeMap<String, ::cosmwasm_schema::schemars::schema::RootSchema> {
402402
::std::collections::BTreeMap::from([
403403
("foo".to_string(), ::cosmwasm_schema::schema_for!(bool)),
404404
("bar".to_string(), ::cosmwasm_schema::schema_for!(u32)),
405405
])
406406
}
407407

408-
fn response_schemas_cw_impl() -> ::std::collections::BTreeMap<String, ::cosmwasm_schema::cw_schema::Schema> {
408+
fn response_schemas_cw() -> ::std::collections::BTreeMap<String, ::cosmwasm_schema::cw_schema::Schema> {
409409
::std::collections::BTreeMap::from([
410410
("foo".to_string(), ::cosmwasm_schema::cw_schema::schema_of::<bool>()),
411411
("bar".to_string(), ::cosmwasm_schema::cw_schema::schema_of::<u32>()),
@@ -420,14 +420,14 @@ mod tests {
420420
#[automatically_derived]
421421
#[cfg(not(target_arch = "wasm32"))]
422422
impl<T: std::fmt::Debug + SomeTrait + ::cosmwasm_schema::schemars::JsonSchema + ::cosmwasm_schema::cw_schema::Schemaifier> ::cosmwasm_schema::QueryResponses for QueryMsg<T> {
423-
fn response_schemas_impl() -> ::std::collections::BTreeMap<String, ::cosmwasm_schema::schemars::schema::RootSchema> {
423+
fn response_schemas() -> ::std::collections::BTreeMap<String, ::cosmwasm_schema::schemars::schema::RootSchema> {
424424
::std::collections::BTreeMap::from([
425425
("foo".to_string(), ::cosmwasm_schema::schema_for!(bool)),
426426
("bar".to_string(), ::cosmwasm_schema::schema_for!(u32)),
427427
])
428428
}
429429

430-
fn response_schemas_cw_impl() -> ::std::collections::BTreeMap<String, ::cosmwasm_schema::cw_schema::Schema> {
430+
fn response_schemas_cw() -> ::std::collections::BTreeMap<String, ::cosmwasm_schema::cw_schema::Schema> {
431431
::std::collections::BTreeMap::from([
432432
("foo".to_string(), ::cosmwasm_schema::cw_schema::schema_of::<bool>()),
433433
("bar".to_string(), ::cosmwasm_schema::cw_schema::schema_of::<u32>()),
@@ -445,14 +445,14 @@ mod tests {
445445
impl<T: ::cosmwasm_schema::schemars::JsonSchema + ::cosmwasm_schema::cw_schema::Schemaifier> ::cosmwasm_schema::QueryResponses for QueryMsg<T>
446446
where T: std::fmt::Debug + SomeTrait,
447447
{
448-
fn response_schemas_impl() -> ::std::collections::BTreeMap<String, ::cosmwasm_schema::schemars::schema::RootSchema> {
448+
fn response_schemas() -> ::std::collections::BTreeMap<String, ::cosmwasm_schema::schemars::schema::RootSchema> {
449449
::std::collections::BTreeMap::from([
450450
("foo".to_string(), ::cosmwasm_schema::schema_for!(bool)),
451451
("bar".to_string(), ::cosmwasm_schema::schema_for!(u32)),
452452
])
453453
}
454454

455-
fn response_schemas_cw_impl() -> ::std::collections::BTreeMap<String, ::cosmwasm_schema::cw_schema::Schema> {
455+
fn response_schemas_cw() -> ::std::collections::BTreeMap<String, ::cosmwasm_schema::cw_schema::Schema> {
456456
::std::collections::BTreeMap::from([
457457
("foo".to_string(), ::cosmwasm_schema::cw_schema::schema_of::<bool>()),
458458
("bar".to_string(), ::cosmwasm_schema::cw_schema::schema_of::<u32>()),
@@ -556,20 +556,20 @@ mod tests {
556556
#[automatically_derived]
557557
#[cfg(not(target_arch = "wasm32"))]
558558
impl ::cosmwasm_schema::QueryResponses for ContractQueryMsg {
559-
fn response_schemas_impl() -> ::std::collections::BTreeMap<String, ::cosmwasm_schema::schemars::schema::RootSchema> {
559+
fn response_schemas() -> ::std::collections::BTreeMap<String, ::cosmwasm_schema::schemars::schema::RootSchema> {
560560
let subqueries = [
561-
<QueryMsg1 as ::cosmwasm_schema::QueryResponses>::response_schemas_impl(),
562-
<whitelist::QueryMsg as ::cosmwasm_schema::QueryResponses>::response_schemas_impl(),
563-
<QueryMsg as ::cosmwasm_schema::QueryResponses>::response_schemas_impl(),
561+
<QueryMsg1 as ::cosmwasm_schema::QueryResponses>::response_schemas(),
562+
<whitelist::QueryMsg as ::cosmwasm_schema::QueryResponses>::response_schemas(),
563+
<QueryMsg as ::cosmwasm_schema::QueryResponses>::response_schemas(),
564564
];
565565
::cosmwasm_schema::combine_subqueries::<3usize, ContractQueryMsg, _>(subqueries)
566566
}
567567

568-
fn response_schemas_cw_impl() -> ::std::collections::BTreeMap<String, ::cosmwasm_schema::cw_schema::Schema> {
568+
fn response_schemas_cw() -> ::std::collections::BTreeMap<String, ::cosmwasm_schema::cw_schema::Schema> {
569569
let subqueries = [
570-
<QueryMsg1 as ::cosmwasm_schema::QueryResponses>::response_schemas_cw_impl(),
571-
<whitelist::QueryMsg as ::cosmwasm_schema::QueryResponses>::response_schemas_cw_impl(),
572-
<QueryMsg as ::cosmwasm_schema::QueryResponses>::response_schemas_cw_impl(),
570+
<QueryMsg1 as ::cosmwasm_schema::QueryResponses>::response_schemas_cw(),
571+
<whitelist::QueryMsg as ::cosmwasm_schema::QueryResponses>::response_schemas_cw(),
572+
<QueryMsg as ::cosmwasm_schema::QueryResponses>::response_schemas_cw(),
573573
];
574574
::cosmwasm_schema::combine_subqueries::<3usize, ContractQueryMsg, _>(subqueries)
575575
}
@@ -593,12 +593,12 @@ mod tests {
593593
#[automatically_derived]
594594
#[cfg(not(target_arch = "wasm32"))]
595595
impl ::cosmwasm_schema::QueryResponses for EmptyMsg {
596-
fn response_schemas_impl() -> ::std::collections::BTreeMap<String, ::cosmwasm_schema::schemars::schema::RootSchema> {
596+
fn response_schemas() -> ::std::collections::BTreeMap<String, ::cosmwasm_schema::schemars::schema::RootSchema> {
597597
let subqueries = [];
598598
::cosmwasm_schema::combine_subqueries::<0usize, EmptyMsg, _>(subqueries)
599599
}
600600

601-
fn response_schemas_cw_impl() -> ::std::collections::BTreeMap<String, ::cosmwasm_schema::cw_schema::Schema> {
601+
fn response_schemas_cw() -> ::std::collections::BTreeMap<String, ::cosmwasm_schema::cw_schema::Schema> {
602602
let subqueries = [];
603603
::cosmwasm_schema::combine_subqueries::<0usize, EmptyMsg, _>(subqueries)
604604
}

packages/schema/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ mod schema_for;
77

88
pub use export::{export_schema, export_schema_with_title};
99
pub use idl::{Api, CwApi, IDL_VERSION};
10-
pub use query_response::{combine_subqueries, IntegrityError, QueryResponses};
10+
pub use query_response::{combine_subqueries, QueryResponses};
1111
pub use remove::remove_schemas;
1212

1313
// Re-exports

0 commit comments

Comments
 (0)