Define UserEvent
This commit is contained in:
parent
ad285898f6
commit
3b766fc427
@ -40,6 +40,7 @@ use rocket::{
|
|||||||
use std::{
|
use std::{
|
||||||
cmp::PartialEq,
|
cmp::PartialEq,
|
||||||
hash::{Hash, Hasher},
|
hash::{Hash, Hasher},
|
||||||
|
sync::Arc,
|
||||||
};
|
};
|
||||||
use url::Url;
|
use url::Url;
|
||||||
use webfinger::*;
|
use webfinger::*;
|
||||||
@ -1126,6 +1127,21 @@ impl NewUser {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug)]
|
||||||
|
pub enum UserEvent {
|
||||||
|
RemoteUserFound(Arc<User>),
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<UserEvent> for Arc<User> {
|
||||||
|
fn from(event: UserEvent) -> Self {
|
||||||
|
use UserEvent::*;
|
||||||
|
|
||||||
|
match event {
|
||||||
|
RemoteUserFound(user) => user,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
pub(crate) mod tests {
|
pub(crate) mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
Loading…
Reference in New Issue
Block a user