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:
Alexander Krotov
2019-11-16 13:40:02 +03:00
committed by holger krekel
parent d808bfe400
commit 0b3f2a55df

View File

@@ -690,6 +690,8 @@ pub fn prepare_msg<'a>(
pub fn msgtype_has_file(msgtype: Viewtype) -> bool {
match msgtype {
Viewtype::Unknown => false,
Viewtype::Text => false,
Viewtype::Image => true,
Viewtype::Gif => true,
Viewtype::Sticker => true,
@@ -697,7 +699,6 @@ pub fn msgtype_has_file(msgtype: Viewtype) -> bool {
Viewtype::Voice => true,
Viewtype::Video => true,
Viewtype::File => true,
_ => false,
}
}