Skip to content

Commit 604ed54

Browse files
committed
Use NonZeroU64
1 parent 071830e commit 604ed54

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

crates/config/src/sections/experimental.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
55
// Please see LICENSE files in the repository root for full details.
66

7+
use std::num::NonZeroU64;
8+
79
use chrono::Duration;
810
use schemars::JsonSchema;
911
use serde::{Deserialize, Serialize};
@@ -118,6 +120,6 @@ impl ConfigurationSection for ExperimentalConfig {
118120
/// Configuration options for the inactive session expiration feature
119121
#[derive(Clone, Debug, Deserialize, JsonSchema, Serialize)]
120122
pub struct SessionLimitConfig {
121-
pub soft_limit: u64,
122-
pub hard_limit: u64,
123+
pub soft_limit: NonZeroU64,
124+
pub hard_limit: NonZeroU64,
123125
}

crates/data-model/src/site_config.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
55
// Please see LICENSE files in the repository root for full details.
66

7+
use std::num::NonZeroU64;
8+
79
use chrono::Duration;
810
use serde::Serialize;
911
use url::Url;
@@ -39,8 +41,8 @@ pub struct SessionExpirationConfig {
3941

4042
#[derive(Serialize, Debug, Clone)]
4143
pub struct SessionLimitConfig {
42-
pub soft_limit: u64,
43-
pub hard_limit: u64,
44+
pub soft_limit: NonZeroU64,
45+
pub hard_limit: NonZeroU64,
4446
}
4547

4648
/// Random site configuration we want accessible in various places.

0 commit comments

Comments
 (0)