Returns either `field` or `self.field` depending on whether the field is an Option or collection.
(&self)
| 187 | /// |
| 188 | /// depending on whether the field is an Option or collection. |
| 189 | pub fn quote_validator_field(&self) -> proc_macro2::TokenStream { |
| 190 | let ident = &self.field.ident; |
| 191 | |
| 192 | if self.is_option() || self.is_list() || self.is_map() { |
| 193 | quote!(#ident) |
| 194 | } else { |
| 195 | quote!(self.#ident) |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | /// Wrap the provided tokens in an `if let Some` block if the field is an option. |
| 200 | pub fn wrap_tokens_if_option( |
no test coverage detected