(path: &mut syn::TypePath)
| 267 | } |
| 268 | |
| 269 | fn payload_path_angle_bracketed(path: &mut syn::TypePath) { |
| 270 | // Type is contained in a List<T>. It will always have angle args and will |
| 271 | // always be the last segment of the path |
| 272 | let syn::PathArguments::AngleBracketed(ref mut args) = |
| 273 | path.path.segments.last_mut().unwrap().arguments |
| 274 | else { |
| 275 | abort!(path.span(), "Cannot apply payload type to field") |
| 276 | }; |
| 277 | |
| 278 | let syn::GenericArgument::Type(syn::Type::Path(ref mut p)) = args.args.last_mut().unwrap() |
| 279 | else { |
| 280 | abort!(path.span(), "Cannot apply payload type to field") |
| 281 | }; |
| 282 | |
| 283 | let Some(segment) = p.path.segments.last_mut() else { |
| 284 | abort!(p.span(), "Invalid path provided for validify") |
| 285 | }; |
| 286 | |
| 287 | segment.ident = format_ident!("{}Payload", segment.ident); |
| 288 | } |
| 289 | |
| 290 | #[allow(dead_code)] |
| 291 | /// Could come in handy, parses the inner contents of an angle bracketed path and outputs |
no outgoing calls
no test coverage detected