Fix codegen

This commit is contained in:
Сырцев Вадим Игоревич 2024-04-04 19:28:06 +03:00
parent 6f7cdd9702
commit 178e6569a1

View file

@ -56,10 +56,15 @@ fn codegen_payloads() {
.map(|field| format!(" @[multipart = {}]\n", field.join(", ")))
.unwrap_or_default();
// FIXME: CreateNewStickerSet has to be be only Debug + Clone + Serialize (maybe
// better fix?)
let derive = if !multipart.is_empty()
|| matches!(
&*method.names.1,
"SendMediaGroup" | "EditMessageMedia" | "EditMessageMediaInline"
"SendMediaGroup"
| "EditMessageMedia"
| "EditMessageMediaInline"
| "CreateNewStickerSet"
) {
"#[derive(Debug, Clone, Serialize)]".to_owned()
} else {
@ -188,7 +193,9 @@ fn eq_hash_suitable(method: &Method) -> bool {
Type::Url | Type::DateTime => true,
Type::RawTy(raw) => raw != "MaskPosition" && raw != "InlineQueryResult",
Type::RawTy(raw) => {
raw != "InputSticker" && raw != "MaskPosition" && raw != "InlineQueryResult"
}
}
}