Debian Codegraph @

src/trait_handlers/into/panic.rs

raw symbols SCIP
1 use crate::common::tools::HashType;
2
3 #[inline]
4 pub(crate) fn reset_a_type(ty: &HashType) -> syn::Error {
5 syn::Error::new(ty.span(), format!("the type `{ty}` is repeatedly set"))
6 }
7
8 #[inline]
9 pub(crate) fn no_into_field(ty: &HashType) -> syn::Error {
10 syn::Error::new(ty.span(), format!("there is no field which is assigned for `Into<{ty}>`"))
11 }
12
13 #[inline]
14 pub(crate) fn no_into_impl(ty: &HashType) -> syn::Error {
15 syn::Error::new(
16 ty.span(),
17 format!(
18 "if you want to impl `Into<{ty}>` for this type, you should write \
19 `#[educe(Into({ty}))]` outside"
20 ),
21 )
22 }
23
24 #[inline]
25 pub(crate) fn multiple_into_fields(ty: &HashType) -> syn::Error {
26 syn::Error::new(ty.span(), format!("multiple fields are set for `Into<{ty}>`"))
27 }