fix: align interface macros with canonical values
This commit is contained in:
@@ -168,9 +168,11 @@ fn expand_interface(attribute: TokenStream2, item: ItemTrait) -> syn::Result<Tok
|
||||
#(#declaration_collectors)*
|
||||
|
||||
::wip_interface::wip_protocol::InterfaceDescriptor {
|
||||
name: ::std::string::String::from(stringify!(#trait_ident)),
|
||||
format: ::std::string::String::from(
|
||||
::wip_interface::wip_protocol::INTERFACE_FORMAT_V1,
|
||||
),
|
||||
documentation: #trait_doc,
|
||||
declarations,
|
||||
types: declarations,
|
||||
operations: ::std::vec![#(#operation_declarations),*],
|
||||
}
|
||||
}
|
||||
@@ -180,9 +182,12 @@ fn expand_interface(attribute: TokenStream2, item: ItemTrait) -> syn::Result<Tok
|
||||
fn dispatch(
|
||||
implementation: &T,
|
||||
operation: &str,
|
||||
arguments: ::std::vec::Vec<::wip_interface::wip_protocol::NamedValue>,
|
||||
arguments: ::std::collections::BTreeMap<
|
||||
::std::string::String,
|
||||
::wip_interface::wip_protocol::Value,
|
||||
>,
|
||||
) -> ::std::result::Result<
|
||||
::std::option::Option<::wip_interface::wip_protocol::Value>,
|
||||
::wip_interface::wip_protocol::Value,
|
||||
::wip_interface::DispatchError,
|
||||
> {
|
||||
let descriptor = Self::descriptor();
|
||||
@@ -207,9 +212,12 @@ fn expand_interface(attribute: TokenStream2, item: ItemTrait) -> syn::Result<Tok
|
||||
pub fn dispatch<T: #trait_ident>(
|
||||
implementation: &T,
|
||||
operation: &str,
|
||||
arguments: ::std::vec::Vec<::wip_interface::wip_protocol::NamedValue>,
|
||||
arguments: ::std::collections::BTreeMap<
|
||||
::std::string::String,
|
||||
::wip_interface::wip_protocol::Value,
|
||||
>,
|
||||
) -> ::std::result::Result<
|
||||
::std::option::Option<::wip_interface::wip_protocol::Value>,
|
||||
::wip_interface::wip_protocol::Value,
|
||||
::wip_interface::DispatchError,
|
||||
> {
|
||||
<Self as ::wip_interface::InterfaceImplementation<T>>::dispatch(
|
||||
@@ -523,12 +531,11 @@ fn argument_item(operation: &Operation) -> TokenStream2 {
|
||||
let encode_result = if operation.unit_result {
|
||||
quote! {
|
||||
let () = result;
|
||||
::std::result::Result::Ok(::std::option::Option::None)
|
||||
::std::result::Result::Ok(::wip_interface::wip_protocol::Value::Unit)
|
||||
}
|
||||
} else {
|
||||
quote! {
|
||||
<#result_ty as ::wip_interface::WipType>::encode(result)
|
||||
.map(::std::option::Option::Some)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -541,9 +548,12 @@ fn argument_item(operation: &Operation) -> TokenStream2 {
|
||||
impl #arguments_ident {
|
||||
/// Decodes named logical values into typed operation arguments.
|
||||
pub fn decode(
|
||||
arguments: ::std::vec::Vec<::wip_interface::wip_protocol::NamedValue>,
|
||||
arguments: ::std::collections::BTreeMap<
|
||||
::std::string::String,
|
||||
::wip_interface::wip_protocol::Value,
|
||||
>,
|
||||
) -> ::std::result::Result<Self, ::wip_interface::CodecError> {
|
||||
let mut decoder = ::wip_interface::__private::RecordDecoder::new(arguments)?;
|
||||
let mut decoder = ::wip_interface::__private::RecordDecoder::new(arguments);
|
||||
let decoded = Self {
|
||||
#(#decoders,)*
|
||||
};
|
||||
@@ -555,7 +565,7 @@ fn argument_item(operation: &Operation) -> TokenStream2 {
|
||||
pub fn encode_result(
|
||||
result: #result_ty,
|
||||
) -> ::std::result::Result<
|
||||
::std::option::Option<::wip_interface::wip_protocol::Value>,
|
||||
::wip_interface::wip_protocol::Value,
|
||||
::wip_interface::CodecError,
|
||||
> {
|
||||
#encode_result
|
||||
@@ -575,22 +585,18 @@ fn operation_declaration(operation: &Operation) -> TokenStream2 {
|
||||
quote! {
|
||||
::wip_interface::wip_protocol::ParameterDeclaration {
|
||||
name: ::std::string::String::from(#parameter_name),
|
||||
required: !#optional,
|
||||
documentation: #parameter_doc,
|
||||
ty: <#ty as ::wip_interface::WipType>::type_expr(),
|
||||
optional: #optional,
|
||||
r#type: <#ty as ::wip_interface::WipType>::type_expr(),
|
||||
}
|
||||
}
|
||||
});
|
||||
let returns = if operation.unit_result {
|
||||
quote!(::std::option::Option::None)
|
||||
} else {
|
||||
let result_ty = &operation.result_ty;
|
||||
let return_doc = documentation_tokens(operation.return_documentation.as_ref());
|
||||
quote! {
|
||||
::std::option::Option::Some(::wip_interface::wip_protocol::ReturnDeclaration {
|
||||
documentation: #return_doc,
|
||||
ty: <#result_ty as ::wip_interface::WipType>::type_expr(),
|
||||
})
|
||||
let result_ty = &operation.result_ty;
|
||||
let return_doc = documentation_tokens(operation.return_documentation.as_ref());
|
||||
let returns = quote! {
|
||||
::wip_interface::wip_protocol::ReturnDeclaration {
|
||||
documentation: #return_doc,
|
||||
r#type: <#result_ty as ::wip_interface::WipType>::type_expr(),
|
||||
}
|
||||
};
|
||||
|
||||
@@ -646,7 +652,7 @@ fn dispatch_arm(operation: &Operation) -> TokenStream2 {
|
||||
let encoded = #arguments_ident::encode_result(result)
|
||||
.map_err(::wip_interface::DispatchError::Encode)?;
|
||||
descriptor
|
||||
.validate_return(#operation_name, encoded.as_ref())
|
||||
.validate_result(#operation_name, &encoded)
|
||||
.map_err(::wip_interface::DispatchError::InvalidResult)?;
|
||||
::std::result::Result::Ok(encoded)
|
||||
}
|
||||
@@ -747,9 +753,9 @@ fn derive_record(
|
||||
quote! {
|
||||
::wip_interface::wip_protocol::FieldDeclaration {
|
||||
name: ::std::string::String::from(#name),
|
||||
required: !#optional,
|
||||
documentation: #documentation,
|
||||
ty: <#ty as ::wip_interface::WipType>::type_expr(),
|
||||
optional: #optional,
|
||||
r#type: <#ty as ::wip_interface::WipType>::type_expr(),
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -765,18 +771,18 @@ fn derive_record(
|
||||
if field.optional {
|
||||
quote! {
|
||||
if let ::std::option::Option::Some(value) = #field_ident {
|
||||
fields.push(::wip_interface::wip_protocol::NamedValue {
|
||||
name: ::std::string::String::from(#field_name),
|
||||
value: <#ty as ::wip_interface::WipType>::encode(value)?,
|
||||
});
|
||||
fields.insert(
|
||||
::std::string::String::from(#field_name),
|
||||
<#ty as ::wip_interface::WipType>::encode(value)?,
|
||||
);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
quote! {
|
||||
fields.push(::wip_interface::wip_protocol::NamedValue {
|
||||
name: ::std::string::String::from(#field_name),
|
||||
value: <#ty as ::wip_interface::WipType>::encode(#field_ident)?,
|
||||
});
|
||||
fields.insert(
|
||||
::std::string::String::from(#field_name),
|
||||
<#ty as ::wip_interface::WipType>::encode(#field_ident)?,
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -794,9 +800,9 @@ fn derive_record(
|
||||
Ok(quote! {
|
||||
impl ::wip_interface::WipType for #ident {
|
||||
fn type_expr() -> ::wip_interface::wip_protocol::TypeExpr {
|
||||
::wip_interface::wip_protocol::TypeExpr::Named(
|
||||
::std::string::String::from(#type_name),
|
||||
)
|
||||
::wip_interface::wip_protocol::TypeExpr::Named {
|
||||
name: ::std::string::String::from(#type_name),
|
||||
}
|
||||
}
|
||||
|
||||
fn collect_declarations(
|
||||
@@ -804,13 +810,13 @@ fn derive_record(
|
||||
::wip_interface::wip_protocol::TypeDeclaration,
|
||||
>,
|
||||
) {
|
||||
let declaration = ::wip_interface::wip_protocol::TypeDeclaration::Record(
|
||||
::wip_interface::wip_protocol::RecordDeclaration {
|
||||
name: ::std::string::String::from(#type_name),
|
||||
documentation: #declaration_doc,
|
||||
let declaration = ::wip_interface::wip_protocol::TypeDeclaration {
|
||||
name: ::std::string::String::from(#type_name),
|
||||
documentation: #declaration_doc,
|
||||
definition: ::wip_interface::wip_protocol::TypeExpr::Record {
|
||||
fields: ::std::vec![#(#field_declarations),*],
|
||||
},
|
||||
);
|
||||
};
|
||||
if ::wip_interface::__private::register_declaration(declarations, declaration) {
|
||||
#(#dependency_collectors)*
|
||||
}
|
||||
@@ -823,7 +829,7 @@ fn derive_record(
|
||||
::wip_interface::CodecError,
|
||||
> {
|
||||
let Self { #(#destructured_fields),* } = self;
|
||||
let mut fields = ::std::vec::Vec::new();
|
||||
let mut fields = ::std::collections::BTreeMap::new();
|
||||
#(#encoders)*
|
||||
::std::result::Result::Ok(
|
||||
::wip_interface::wip_protocol::Value::Record(fields),
|
||||
@@ -835,7 +841,7 @@ fn derive_record(
|
||||
) -> ::std::result::Result<Self, ::wip_interface::CodecError> {
|
||||
match value {
|
||||
::wip_interface::wip_protocol::Value::Record(fields) => {
|
||||
let mut decoder = ::wip_interface::__private::RecordDecoder::new(fields)?;
|
||||
let mut decoder = ::wip_interface::__private::RecordDecoder::new(fields);
|
||||
let decoded = Self {
|
||||
#(#decoders,)*
|
||||
};
|
||||
@@ -870,14 +876,14 @@ fn derive_enum(
|
||||
.variants
|
||||
.iter()
|
||||
.all(|variant| matches!(variant.fields, Fields::Unit));
|
||||
let all_payload = !data.variants.is_empty()
|
||||
&& data.variants.iter().all(|variant| {
|
||||
matches!(&variant.fields, Fields::Unnamed(fields) if fields.unnamed.len() == 1)
|
||||
});
|
||||
let valid_union = data.variants.iter().all(|variant| {
|
||||
matches!(variant.fields, Fields::Unit)
|
||||
|| matches!(&variant.fields, Fields::Unnamed(fields) if fields.unnamed.len() == 1)
|
||||
});
|
||||
|
||||
if all_unit {
|
||||
derive_unit_enum(ident, type_name, type_documentation, data)
|
||||
} else if all_payload {
|
||||
} else if valid_union {
|
||||
derive_union_enum(ident, type_name, type_documentation, data)
|
||||
} else {
|
||||
let span = data
|
||||
@@ -890,7 +896,7 @@ fn derive_enum(
|
||||
.map_or_else(|| data.enum_token.span, Spanned::span);
|
||||
Err(Error::new(
|
||||
span,
|
||||
"a `WipType` enum must contain either only unit variants or only single-field tuple variants; mixed and named-field variants are unsupported",
|
||||
"a `WipType` enum must contain unit variants and/or single-field tuple variants; named-field and multi-field variants are unsupported",
|
||||
))
|
||||
}
|
||||
}
|
||||
@@ -906,7 +912,7 @@ fn derive_unit_enum(
|
||||
let name = source_name(&variant.ident);
|
||||
let documentation = documentation_tokens(documentation(&variant.attrs).as_ref());
|
||||
quote! {
|
||||
::wip_interface::wip_protocol::EnumVariantDeclaration {
|
||||
::wip_interface::wip_protocol::EnumCase {
|
||||
name: ::std::string::String::from(#name),
|
||||
documentation: #documentation,
|
||||
}
|
||||
@@ -926,9 +932,9 @@ fn derive_unit_enum(
|
||||
Ok(quote! {
|
||||
impl ::wip_interface::WipType for #ident {
|
||||
fn type_expr() -> ::wip_interface::wip_protocol::TypeExpr {
|
||||
::wip_interface::wip_protocol::TypeExpr::Named(
|
||||
::std::string::String::from(#type_name),
|
||||
)
|
||||
::wip_interface::wip_protocol::TypeExpr::Named {
|
||||
name: ::std::string::String::from(#type_name),
|
||||
}
|
||||
}
|
||||
|
||||
fn collect_declarations(
|
||||
@@ -936,13 +942,13 @@ fn derive_unit_enum(
|
||||
::wip_interface::wip_protocol::TypeDeclaration,
|
||||
>,
|
||||
) {
|
||||
let declaration = ::wip_interface::wip_protocol::TypeDeclaration::Enum(
|
||||
::wip_interface::wip_protocol::EnumDeclaration {
|
||||
name: ::std::string::String::from(#type_name),
|
||||
documentation: #declaration_doc,
|
||||
variants: ::std::vec![#(#declarations),*],
|
||||
let declaration = ::wip_interface::wip_protocol::TypeDeclaration {
|
||||
name: ::std::string::String::from(#type_name),
|
||||
documentation: #declaration_doc,
|
||||
definition: ::wip_interface::wip_protocol::TypeExpr::Enum {
|
||||
cases: ::std::vec![#(#declarations),*],
|
||||
},
|
||||
);
|
||||
};
|
||||
let _ = ::wip_interface::__private::register_declaration(
|
||||
declarations,
|
||||
declaration,
|
||||
@@ -959,7 +965,7 @@ fn derive_unit_enum(
|
||||
#(#encoders,)*
|
||||
};
|
||||
::std::result::Result::Ok(
|
||||
::wip_interface::wip_protocol::Value::Enum(
|
||||
::wip_interface::wip_protocol::Value::String(
|
||||
::std::string::String::from(variant),
|
||||
),
|
||||
)
|
||||
@@ -969,7 +975,7 @@ fn derive_unit_enum(
|
||||
value: ::wip_interface::wip_protocol::Value,
|
||||
) -> ::std::result::Result<Self, ::wip_interface::CodecError> {
|
||||
match value {
|
||||
::wip_interface::wip_protocol::Value::Enum(variant) => {
|
||||
::wip_interface::wip_protocol::Value::String(variant) => {
|
||||
match variant.as_str() {
|
||||
#(#decoders,)*
|
||||
_ => ::std::result::Result::Err(
|
||||
@@ -998,35 +1004,36 @@ fn derive_union_enum(
|
||||
struct Variant<'a> {
|
||||
ident: &'a Ident,
|
||||
name: String,
|
||||
ty: &'a Type,
|
||||
payload: Option<&'a Type>,
|
||||
documentation: Option<Documentation>,
|
||||
}
|
||||
|
||||
let mut variants = Vec::new();
|
||||
for variant in &data.variants {
|
||||
let Fields::Unnamed(fields) = &variant.fields else {
|
||||
return Err(Error::new_spanned(
|
||||
variant,
|
||||
"a `WipType` union variant must contain exactly one unnamed field",
|
||||
));
|
||||
let payload = match &variant.fields {
|
||||
Fields::Unit => None,
|
||||
Fields::Unnamed(fields) if fields.unnamed.len() == 1 => {
|
||||
let field = fields.unnamed.first().expect("length checked");
|
||||
if direct_option(&field.ty)?.is_some() || contains_option(&field.ty) {
|
||||
return Err(Error::new_spanned(
|
||||
&field.ty,
|
||||
"`Option<T>` is only supported directly on DTO fields and operation parameters",
|
||||
));
|
||||
}
|
||||
validate_value_type(&field.ty, "union case payload")?;
|
||||
Some(&field.ty)
|
||||
}
|
||||
_ => {
|
||||
return Err(Error::new_spanned(
|
||||
variant,
|
||||
"a `WipType` union case must be unit-like or contain exactly one unnamed payload",
|
||||
));
|
||||
}
|
||||
};
|
||||
let Some(field) = fields.unnamed.first() else {
|
||||
return Err(Error::new_spanned(
|
||||
fields,
|
||||
"a `WipType` union variant must contain exactly one unnamed field",
|
||||
));
|
||||
};
|
||||
if direct_option(&field.ty)?.is_some() || contains_option(&field.ty) {
|
||||
return Err(Error::new_spanned(
|
||||
&field.ty,
|
||||
"`Option<T>` is only supported directly on DTO fields and operation parameters",
|
||||
));
|
||||
}
|
||||
validate_value_type(&field.ty, "union variant payload")?;
|
||||
variants.push(Variant {
|
||||
ident: &variant.ident,
|
||||
name: source_name(&variant.ident),
|
||||
ty: &field.ty,
|
||||
payload,
|
||||
documentation: documentation(&variant.attrs),
|
||||
});
|
||||
}
|
||||
@@ -1035,50 +1042,95 @@ fn derive_union_enum(
|
||||
let declarations = variants.iter().map(|variant| {
|
||||
let name = &variant.name;
|
||||
let documentation = documentation_tokens(variant.documentation.as_ref());
|
||||
let ty = variant.ty;
|
||||
let payload = match variant.payload {
|
||||
Some(ty) => quote! {
|
||||
::std::option::Option::Some(
|
||||
<#ty as ::wip_interface::WipType>::type_expr(),
|
||||
)
|
||||
},
|
||||
None => quote!(::std::option::Option::None),
|
||||
};
|
||||
quote! {
|
||||
::wip_interface::wip_protocol::UnionVariantDeclaration {
|
||||
::wip_interface::wip_protocol::UnionCase {
|
||||
name: ::std::string::String::from(#name),
|
||||
documentation: #documentation,
|
||||
ty: <#ty as ::wip_interface::WipType>::type_expr(),
|
||||
payload: #payload,
|
||||
}
|
||||
}
|
||||
});
|
||||
let dependency_collectors = variants.iter().map(|variant| {
|
||||
let ty = variant.ty;
|
||||
quote!(<#ty as ::wip_interface::WipType>::collect_declarations(declarations);)
|
||||
let dependency_collectors = variants.iter().filter_map(|variant| {
|
||||
variant.payload.map(
|
||||
|ty| quote!(<#ty as ::wip_interface::WipType>::collect_declarations(declarations);),
|
||||
)
|
||||
});
|
||||
let encoders = variants.iter().map(|variant| {
|
||||
let variant_ident = variant.ident;
|
||||
let name = &variant.name;
|
||||
let ty = variant.ty;
|
||||
quote! {
|
||||
Self::#variant_ident(value) => {
|
||||
::wip_interface::wip_protocol::Value::Union {
|
||||
variant: ::std::string::String::from(#name),
|
||||
value: ::std::boxed::Box::new(
|
||||
match variant.payload {
|
||||
Some(ty) => quote! {
|
||||
Self::#variant_ident(value) => {
|
||||
let mut fields = ::std::collections::BTreeMap::new();
|
||||
fields.insert(
|
||||
::std::string::String::from(
|
||||
::wip_interface::wip_protocol::UNION_CASE_FIELD,
|
||||
),
|
||||
::wip_interface::wip_protocol::Value::String(
|
||||
::std::string::String::from(#name),
|
||||
),
|
||||
);
|
||||
fields.insert(
|
||||
::std::string::String::from(
|
||||
::wip_interface::wip_protocol::UNION_VALUE_FIELD,
|
||||
),
|
||||
<#ty as ::wip_interface::WipType>::encode(value)?,
|
||||
),
|
||||
);
|
||||
::wip_interface::wip_protocol::Value::Record(fields)
|
||||
}
|
||||
}
|
||||
},
|
||||
None => quote! {
|
||||
Self::#variant_ident => {
|
||||
let mut fields = ::std::collections::BTreeMap::new();
|
||||
fields.insert(
|
||||
::std::string::String::from(
|
||||
::wip_interface::wip_protocol::UNION_CASE_FIELD,
|
||||
),
|
||||
::wip_interface::wip_protocol::Value::String(
|
||||
::std::string::String::from(#name),
|
||||
),
|
||||
);
|
||||
::wip_interface::wip_protocol::Value::Record(fields)
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
let decoders = variants.iter().map(|variant| {
|
||||
let variant_ident = variant.ident;
|
||||
let name = &variant.name;
|
||||
let ty = variant.ty;
|
||||
quote! {
|
||||
#name => <#ty as ::wip_interface::WipType>::decode(*value)
|
||||
.map(Self::#variant_ident)
|
||||
match variant.payload {
|
||||
Some(ty) => quote! {
|
||||
#name => {
|
||||
let value = decoder.required::<#ty>(
|
||||
::wip_interface::wip_protocol::UNION_VALUE_FIELD,
|
||||
)?;
|
||||
decoder.finish()?;
|
||||
::std::result::Result::Ok(Self::#variant_ident(value))
|
||||
}
|
||||
},
|
||||
None => quote! {
|
||||
#name => {
|
||||
decoder.finish()?;
|
||||
::std::result::Result::Ok(Self::#variant_ident)
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
Ok(quote! {
|
||||
impl ::wip_interface::WipType for #ident {
|
||||
fn type_expr() -> ::wip_interface::wip_protocol::TypeExpr {
|
||||
::wip_interface::wip_protocol::TypeExpr::Named(
|
||||
::std::string::String::from(#type_name),
|
||||
)
|
||||
::wip_interface::wip_protocol::TypeExpr::Named {
|
||||
name: ::std::string::String::from(#type_name),
|
||||
}
|
||||
}
|
||||
|
||||
fn collect_declarations(
|
||||
@@ -1086,13 +1138,13 @@ fn derive_union_enum(
|
||||
::wip_interface::wip_protocol::TypeDeclaration,
|
||||
>,
|
||||
) {
|
||||
let declaration = ::wip_interface::wip_protocol::TypeDeclaration::Union(
|
||||
::wip_interface::wip_protocol::UnionDeclaration {
|
||||
name: ::std::string::String::from(#type_name),
|
||||
documentation: #declaration_doc,
|
||||
variants: ::std::vec![#(#declarations),*],
|
||||
let declaration = ::wip_interface::wip_protocol::TypeDeclaration {
|
||||
name: ::std::string::String::from(#type_name),
|
||||
documentation: #declaration_doc,
|
||||
definition: ::wip_interface::wip_protocol::TypeExpr::Union {
|
||||
cases: ::std::vec![#(#declarations),*],
|
||||
},
|
||||
);
|
||||
};
|
||||
if ::wip_interface::__private::register_declaration(declarations, declaration) {
|
||||
#(#dependency_collectors)*
|
||||
}
|
||||
@@ -1114,26 +1166,30 @@ fn derive_union_enum(
|
||||
value: ::wip_interface::wip_protocol::Value,
|
||||
) -> ::std::result::Result<Self, ::wip_interface::CodecError> {
|
||||
match value {
|
||||
::wip_interface::wip_protocol::Value::Union { variant, value } => {
|
||||
match variant.as_str() {
|
||||
::wip_interface::wip_protocol::Value::Record(fields) => {
|
||||
let mut decoder =
|
||||
::wip_interface::__private::RecordDecoder::new(fields);
|
||||
let case = decoder.required::<::std::string::String>(
|
||||
::wip_interface::wip_protocol::UNION_CASE_FIELD,
|
||||
)?;
|
||||
match case.as_str() {
|
||||
#(#decoders,)*
|
||||
_ => ::std::result::Result::Err(
|
||||
::wip_interface::__private::decode_unknown_variant(
|
||||
#type_name,
|
||||
variant,
|
||||
case,
|
||||
),
|
||||
),
|
||||
}
|
||||
}
|
||||
actual => ::std::result::Result::Err(
|
||||
::wip_interface::__private::decode_type_mismatch("union", actual),
|
||||
::wip_interface::__private::decode_type_mismatch("union record", actual),
|
||||
),
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fn optional_type(ty: &Type, context: &str) -> syn::Result<(bool, Type)> {
|
||||
if let Some(inner) = direct_option(ty)? {
|
||||
if contains_option(&inner) {
|
||||
|
||||
Reference in New Issue
Block a user