(ty: &str)
| 825 | } |
| 826 | |
| 827 | fn strip_sized_layer(ty: &str) -> &str { |
| 828 | let ty = ty |
| 829 | .strip_prefix("Sized<") |
| 830 | .unwrap_or_else(|| panic!("expect a sized layer, but get: {ty}")); |
| 831 | let idx = ty |
| 832 | .find('>') |
| 833 | .unwrap_or_else(|| panic!("sized layer should contain a '>', but get: {ty}")); |
| 834 | &ty[idx + 1..] |
| 835 | } |
| 836 | |
| 837 | pub fn is_array_ty(ty: &str) -> bool { |
| 838 | if is_const_pointer_ty(ty) || is_mut_pointer_ty(ty) { |