This commit is contained in:
Felix Ableitner 2024-05-23 12:59:20 +02:00
parent 5e1a98cc9f
commit 0c487a65eb
2 changed files with 9 additions and 4 deletions

View file

@ -127,7 +127,9 @@ pub struct LanguageId(pub i32);
/// The comment reply id. /// The comment reply id.
pub struct CommentReplyId(i32); pub struct CommentReplyId(i32);
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default, Ord, PartialOrd)] #[derive(
Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default, Ord, PartialOrd,
)]
#[cfg_attr(feature = "full", derive(DieselNewType, TS))] #[cfg_attr(feature = "full", derive(DieselNewType, TS))]
#[cfg_attr(feature = "full", ts(export))] #[cfg_attr(feature = "full", ts(export))]
/// The instance id. /// The instance id.

View file

@ -164,8 +164,11 @@ mod test {
}; };
use lemmy_utils::error::LemmyError; use lemmy_utils::error::LemmyError;
use serial_test::serial; use serial_test::serial;
use std::sync::{Arc, Mutex}; use std::{
use tokio::{spawn, time::sleep};use std::collections::HashSet; collections::HashSet,
sync::{Arc, Mutex},
};
use tokio::{spawn, time::sleep};
struct TestData { struct TestData {
send_manager: SendManager, send_manager: SendManager,
@ -228,7 +231,7 @@ mod test {
data.run().await?; data.run().await?;
assert_eq!(3, data.send_manager.workers.len()); assert_eq!(3, data.send_manager.workers.len());
let workers: HashSet<_> = data.send_manager.workers.keys().cloned().collect(); let workers: HashSet<_> = data.send_manager.workers.keys().cloned().collect();
let instances: HashSet<_> = data.instances.iter().map(|i|i.id).collect(); let instances: HashSet<_> = data.instances.iter().map(|i| i.id).collect();
assert_eq!(instances, workers); assert_eq!(instances, workers);
data.cleanup().await?; data.cleanup().await?;