summaryrefslogtreecommitdiff
path: root/src/user
diff options
context:
space:
mode:
Diffstat (limited to 'src/user')
-rw-r--r--src/user/app.rs3
-rw-r--r--src/user/create.rs5
2 files changed, 3 insertions, 5 deletions
diff --git a/src/user/app.rs b/src/user/app.rs
index 5f58981..301c39c 100644
--- a/src/user/app.rs
+++ b/src/user/app.rs
@@ -29,7 +29,8 @@ impl<'a> Users<'a> {
let stored = validated.store(&mut tx).await?;
tx.commit().await?;
- let user = stored.publish(self.events);
+ let user = stored.user().to_owned();
+ stored.publish(self.events);
Ok(user.as_created())
}
diff --git a/src/user/create.rs b/src/user/create.rs
index 0e7a118..5d7bf65 100644
--- a/src/user/create.rs
+++ b/src/user/create.rs
@@ -73,13 +73,10 @@ pub struct Stored {
}
impl Stored {
- #[must_use = "dropping a user creation attempt is likely a mistake"]
- pub fn publish(self, events: &Broadcaster) -> History {
+ pub fn publish(self, events: &Broadcaster) {
let Self { user } = self;
events.broadcast(user.events().map(Event::from).collect::<Vec<_>>());
-
- user
}
pub fn user(&self) -> &History {