Returns true if the field is an option.
(&self)
| 322 | |
| 323 | /// Returns true if the field is an option. |
| 324 | pub fn is_option(&self) -> bool { |
| 325 | let syn::Type::Path(ref p) = self.field.ty else { |
| 326 | return false; |
| 327 | }; |
| 328 | |
| 329 | p.path |
| 330 | .segments |
| 331 | .last() |
| 332 | .is_some_and(|seg| seg.ident == "Option") |
| 333 | } |
| 334 | |
| 335 | /// Returns true if the field is &'_ T, or Option<&'_ T>. |
| 336 | pub fn is_reference(&self) -> bool { |
no outgoing calls
no test coverage detected