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-30 19:23:22 +00:00
committed by l
parent fb4fdeb470
commit 62d3f3877f
7 changed files with 124 additions and 188 deletions

View File

@@ -726,9 +726,9 @@ impl From<deltachat::ephemeral::Timer> for EphemeralTimer {
fn from(value: deltachat::ephemeral::Timer) -> Self {
match value {
deltachat::ephemeral::Timer::Disabled => EphemeralTimer::Disabled,
deltachat::ephemeral::Timer::Enabled { duration } => {
EphemeralTimer::Enabled { duration }
}
deltachat::ephemeral::Timer::Enabled { duration } => EphemeralTimer::Enabled {
duration: duration.get(),
},
}
}
}