mirror of
https://github.com/chatmail/core.git
synced 2026-04-28 02:46:29 +03:00
Do not use wildcard match in msgtype_has_file
This way there will be a compiler error notifying that the function needs to be updated when a new message type is added.
This commit is contained in:
committed by
holger krekel
parent
d808bfe400
commit
0b3f2a55df
@@ -690,6 +690,8 @@ pub fn prepare_msg<'a>(
|
|||||||
|
|
||||||
pub fn msgtype_has_file(msgtype: Viewtype) -> bool {
|
pub fn msgtype_has_file(msgtype: Viewtype) -> bool {
|
||||||
match msgtype {
|
match msgtype {
|
||||||
|
Viewtype::Unknown => false,
|
||||||
|
Viewtype::Text => false,
|
||||||
Viewtype::Image => true,
|
Viewtype::Image => true,
|
||||||
Viewtype::Gif => true,
|
Viewtype::Gif => true,
|
||||||
Viewtype::Sticker => true,
|
Viewtype::Sticker => true,
|
||||||
@@ -697,7 +699,6 @@ pub fn msgtype_has_file(msgtype: Viewtype) -> bool {
|
|||||||
Viewtype::Voice => true,
|
Viewtype::Voice => true,
|
||||||
Viewtype::Video => true,
|
Viewtype::Video => true,
|
||||||
Viewtype::File => true,
|
Viewtype::File => true,
|
||||||
_ => false,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user