fix some warns

This commit is contained in:
🪞👃🪞 2025-09-07 23:13:19 +03:00
parent baa582b9dd
commit d6dcf137a8
4 changed files with 28 additions and 30 deletions

View file

@ -9,8 +9,8 @@ pub(crate) struct ExposeMeta;
#[derive(Debug, Clone)]
pub(crate) struct ExposeImpl(ItemImpl, BTreeMap<ExposeType, BTreeMap<String, Ident>>);
#[derive(Debug, Clone)]
struct ExposeSym(LitStr);
//#[derive(Debug, Clone)]
//struct ExposeSym(LitStr);
#[derive(Debug, Clone)]
struct ExposeType(Box<Type>);
@ -169,33 +169,33 @@ impl ExposeImpl {
}
}
impl From<LitStr> for ExposeSym { fn from (this: LitStr) -> Self { Self(this) } }
//impl From<LitStr> for ExposeSym { fn from (this: LitStr) -> Self { Self(this) } }
impl PartialOrd for ExposeSym {
fn partial_cmp (&self, other: &Self) -> Option<Ordering> {
let this = &self.0;
let that = &other.0;
Some(format!("{}", quote! { #this }).cmp(&format!("{}", quote! { #that })))
}
}
//impl PartialOrd for ExposeSym {
//fn partial_cmp (&self, other: &Self) -> Option<Ordering> {
//let this = &self.0;
//let that = &other.0;
//Some(format!("{}", quote! { #this }).cmp(&format!("{}", quote! { #that })))
//}
//}
impl Ord for ExposeSym {
fn cmp (&self, other: &Self) -> Ordering {
let this = &self.0;
let that = &other.0;
format!("{}", quote! { #this }).cmp(&format!("{}", quote! { #that }))
}
}
//impl Ord for ExposeSym {
//fn cmp (&self, other: &Self) -> Ordering {
//let this = &self.0;
//let that = &other.0;
//format!("{}", quote! { #this }).cmp(&format!("{}", quote! { #that }))
//}
//}
impl PartialEq for ExposeSym {
fn eq (&self, other: &Self) -> bool {
let this = &self.0;
let that = &other.0;
format!("{}", quote! { #this }) == format!("{}", quote! { #that })
}
}
//impl PartialEq for ExposeSym {
//fn eq (&self, other: &Self) -> bool {
//let this = &self.0;
//let that = &other.0;
//format!("{}", quote! { #this }) == format!("{}", quote! { #that })
//}
//}
impl Eq for ExposeSym {}
//impl Eq for ExposeSym {}
impl From<Type> for ExposeType { fn from (this: Type) -> Self { Self(Box::new(this)) } }