Improve documentation, mostly by hiding behind pub(crate)

This commit is contained in:
Alexander Krotov
2020-02-20 22:52:54 +03:00
parent e94c62e5b3
commit 508b8ef2e2
8 changed files with 50 additions and 40 deletions

View File

@@ -46,26 +46,17 @@ pub struct MimeMessage {
pub is_system_message: SystemMessage,
pub location_kml: Option<location::Kml>,
pub message_kml: Option<location::Kml>,
pub user_avatar: Option<AvatarAction>,
pub group_avatar: Option<AvatarAction>,
pub(crate) user_avatar: Option<AvatarAction>,
pub(crate) group_avatar: Option<AvatarAction>,
pub(crate) reports: Vec<Report>,
}
#[derive(Debug, PartialEq)]
pub enum AvatarAction {
pub(crate) enum AvatarAction {
Delete,
Change(String),
}
impl AvatarAction {
pub fn is_change(&self) -> bool {
match self {
AvatarAction::Delete => false,
AvatarAction::Change(_) => true,
}
}
}
#[derive(Debug, Display, Clone, Copy, PartialEq, Eq, FromPrimitive, ToPrimitive, ToSql, FromSql)]
#[repr(i32)]
pub enum SystemMessage {
@@ -1094,6 +1085,15 @@ mod tests {
use super::*;
use crate::test_utils::*;
impl AvatarAction {
pub fn is_change(&self) -> bool {
match self {
AvatarAction::Delete => false,
AvatarAction::Change(_) => true,
}
}
}
#[test]
fn test_dc_mimeparser_crash() {
let context = dummy_context();