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:
link2xt
2026-07-31 23:55:49 +00:00
committed by l
parent fb4fdeb470
commit 62d3f3877f
7 changed files with 124 additions and 188 deletions
+1 -1
View File
@@ -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?;