(
&self,
tokens: proc_macro2::TokenStream,
)
| 254 | } |
| 255 | |
| 256 | pub fn wrap_modifier_if_option( |
| 257 | &self, |
| 258 | tokens: proc_macro2::TokenStream, |
| 259 | ) -> proc_macro2::TokenStream { |
| 260 | let field_ident = &self.field.ident; |
| 261 | |
| 262 | if self.is_option() { |
| 263 | let this = self.option_self_tokens_modifications(); |
| 264 | return quote!( |
| 265 | if let #this = self.#field_ident.as_mut() { |
| 266 | #tokens |
| 267 | } |
| 268 | ); |
| 269 | } |
| 270 | |
| 271 | tokens |
| 272 | } |
| 273 | |
| 274 | /// Wrap the quoted output of a modification in a for loop if |
| 275 | /// the field type is a collection. |
no test coverage detected