diff options
Diffstat (limited to 'entities/src')
-rw-r--r-- | entities/src/admin/cohort.rs | 2 | ||||
-rw-r--r-- | entities/src/admin/dimension.rs | 2 | ||||
-rw-r--r-- | entities/src/admin/email_domain_block.rs | 4 | ||||
-rw-r--r-- | entities/src/admin/ip_block.rs | 2 | ||||
-rw-r--r-- | entities/src/admin/measure.rs | 2 | ||||
-rw-r--r-- | entities/src/announcement.rs | 1 | ||||
-rw-r--r-- | entities/src/filter.rs | 2 | ||||
-rw-r--r-- | entities/src/ids.rs | 1 | ||||
-rw-r--r-- | entities/src/instance.rs | 10 | ||||
-rw-r--r-- | entities/src/status/poll.rs | 2 | ||||
-rw-r--r-- | entities/src/test.rs | 19 |
11 files changed, 30 insertions, 17 deletions
diff --git a/entities/src/admin/cohort.rs b/entities/src/admin/cohort.rs index 14f925a..c5e1a83 100644 --- a/entities/src/admin/cohort.rs +++ b/entities/src/admin/cohort.rs @@ -1,7 +1,7 @@ +use crate::conversion; use is_variant::IsVariant; use serde::{Deserialize, Serialize}; use time::{serde::iso8601, OffsetDateTime}; -use crate::conversion; /// Represents a retention metric. /// diff --git a/entities/src/admin/dimension.rs b/entities/src/admin/dimension.rs index 89ef1ba..bcd71ec 100644 --- a/entities/src/admin/dimension.rs +++ b/entities/src/admin/dimension.rs @@ -69,4 +69,4 @@ mod tests { assert_eq!(data.unit.as_ref().unwrap(), "bytes"); assert_eq!(data.human_value.as_ref().unwrap(), "14.2 MB"); } -}
\ No newline at end of file +} diff --git a/entities/src/admin/email_domain_block.rs b/entities/src/admin/email_domain_block.rs index 0fbd333..c324441 100644 --- a/entities/src/admin/email_domain_block.rs +++ b/entities/src/admin/email_domain_block.rs @@ -1,5 +1,5 @@ use serde::{Deserialize, Serialize}; -use time::{serde::iso8601, OffsetDateTime, Date}; +use time::{serde::iso8601, Date, OffsetDateTime}; use crate::{conversion, EmailDomainBlockId}; @@ -93,4 +93,4 @@ mod tests { assert_eq!(entry.day.day(), (16 - i) as u8); } } -}
\ No newline at end of file +} diff --git a/entities/src/admin/ip_block.rs b/entities/src/admin/ip_block.rs index a50084f..70f48da 100644 --- a/entities/src/admin/ip_block.rs +++ b/entities/src/admin/ip_block.rs @@ -57,4 +57,4 @@ mod tests { assert!(subject.comment.is_empty()); assert!(subject.expires_at.is_none()); } -}
\ No newline at end of file +} diff --git a/entities/src/admin/measure.rs b/entities/src/admin/measure.rs index 3dd95c3..5ec4de8 100644 --- a/entities/src/admin/measure.rs +++ b/entities/src/admin/measure.rs @@ -98,4 +98,4 @@ mod tests { assert_eq!(date.month(), Month::September); assert_eq!(date.day(), 14); } -}
\ No newline at end of file +} diff --git a/entities/src/announcement.rs b/entities/src/announcement.rs index 7154485..d72501b 100644 --- a/entities/src/announcement.rs +++ b/entities/src/announcement.rs @@ -140,7 +140,6 @@ mod tests { assert_eq!(reaction.count, 9); assert!(reaction.me.is_some()); assert!(!reaction.me.unwrap()); - assert_eq!(reaction.url, reaction.static_url); assert_eq!(reaction.url.as_ref().map(|it| it.as_ref()), Some("https://files.mastodon.social/custom_emojis/images/000/067/715/original/fdba57dff7576d53.png")); } diff --git a/entities/src/filter.rs b/entities/src/filter.rs index 6b289aa..3e859d0 100644 --- a/entities/src/filter.rs +++ b/entities/src/filter.rs @@ -2,7 +2,7 @@ use derive_is_enum_variant::is_enum_variant; use serde::{de::Visitor, Deserialize, Deserializer, Serialize}; use time::{serde::iso8601, OffsetDateTime}; -use crate::{FilterId, StatusId, KeywordId, FilteredStatusId}; +use crate::{FilterId, FilteredStatusId, KeywordId, StatusId}; /// Represents a user-defined filter for determining which statuses should not /// be shown to the user. diff --git a/entities/src/ids.rs b/entities/src/ids.rs index ecf6d87..d56e5ce 100644 --- a/entities/src/ids.rs +++ b/entities/src/ids.rs @@ -69,4 +69,3 @@ define_ids!( As [`Application`] doesn't have an ID, I'm not sure what you're supposed to compare this to." as ApplicationId(from i64, as i64 ref), "a role ID" as RoleId(from i64, as i64 ref), ); - diff --git a/entities/src/instance.rs b/entities/src/instance.rs index 16d34d6..861e2b6 100644 --- a/entities/src/instance.rs +++ b/entities/src/instance.rs @@ -600,7 +600,10 @@ mod tests { assert_eq!(subject.domain, "mastodon.social"); let rule = &subject.rules[0]; assert_eq!(rule.id, RuleId::new("1")); - assert_eq!(rule.text, "Sexually explicit or violent media must be marked as sensitive when posting"); + assert_eq!( + rule.text, + "Sexually explicit or violent media must be marked as sensitive when posting" + ); } #[test] @@ -627,7 +630,10 @@ mod tests { }"#; let subject: DomainBlock = serde_json::from_str(example).unwrap(); assert_eq!(subject.domain, "daji******.com"); - assert_eq!(subject.digest, "3752f63a7079d60c2de5dceb8bd7608e86a15544eb78a494a482041c3684b37f"); + assert_eq!( + subject.digest, + "3752f63a7079d60c2de5dceb8bd7608e86a15544eb78a494a482041c3684b37f" + ); assert!(subject.severity.is_suspend()); assert_eq!(subject.comment.unwrap(), "Inappropriate content"); } diff --git a/entities/src/status/poll.rs b/entities/src/status/poll.rs index fd72dfb..a25235b 100644 --- a/entities/src/status/poll.rs +++ b/entities/src/status/poll.rs @@ -91,4 +91,4 @@ mod tests { assert_eq!(option.votes_count, Some(4)); assert!(poll.emojis.is_empty()); } -}
\ No newline at end of file +} diff --git a/entities/src/test.rs b/entities/src/test.rs index e0b3db1..d273b86 100644 --- a/entities/src/test.rs +++ b/entities/src/test.rs @@ -3,10 +3,19 @@ macro_rules! serde_value_test { ($fn_name:ident($ty:ty): $example:literal) => { #[test] fn $fn_name() { - let subject: $ty = serde_json::from_str($example).expect(concat!("example for ", stringify!($ty), " failed to deserialize")); - let as_value: serde_json::Value = serde_json::from_str($example).expect(concat!("example for ", stringify!($ty), " couldn't be parsed as Value")); - let subject_as_value = serde_json::to_value(subject).expect("failed to convert to value"); + let subject: $ty = serde_json::from_str($example).expect(concat!( + "example for ", + stringify!($ty), + " failed to deserialize" + )); + let as_value: serde_json::Value = serde_json::from_str($example).expect(concat!( + "example for ", + stringify!($ty), + " couldn't be parsed as Value" + )); + let subject_as_value = + serde_json::to_value(subject).expect("failed to convert to value"); assert_eq!(as_value, subject_as_value); } - } -}
\ No newline at end of file + }; +} |