mirror of
https://github.com/chatmail/core.git
synced 2026-10-03 03:30:36 +03:00
refactor: mark enabled ephemeral timer duration as NonZero
Now the type system ensures that Timer::Enabled never stores 0 value inside accidentally, it is impossible to put 0 there without unsafe code.
This commit is contained in:
+1
-1
@@ -1899,7 +1899,7 @@ impl Chat {
|
||||
};
|
||||
let ephemeral_timestamp = match ephemeral_timer {
|
||||
EphemeralTimer::Disabled => 0,
|
||||
EphemeralTimer::Enabled { duration } => time().saturating_add(duration.into()),
|
||||
EphemeralTimer::Enabled { duration } => time().saturating_add(duration.get().into()),
|
||||
};
|
||||
|
||||
let (msg_text, was_truncated) = truncate_msg_text(context, msg.text.clone()).await?;
|
||||
|
||||
Reference in New Issue
Block a user