macro: don't enforce the AsOptionStr type on formats

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2019-07-30 10:33:07 +02:00
parent fab0210287
commit a6fcaf27e5

View File

@ -638,9 +638,7 @@ fn named_struct_impl_verify(span: Span, fields: &[StructField]) -> Result<TokenS
if let Some(ref value) = field.def.format {
body.extend(quote_spanned! { value.span() =>
if !#value::verify(::proxmox::api::meta::AsOptionStr::as_option_str(
&self.#field_ident,
)) {
if !#value::verify(&self.#field_ident) {
error_string.push_str(
&format!("field {} does not match format {}", #field_str, #value::NAME)
);