From 0757ad08e776665603cba238301295ad27132d06 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Thu, 27 Jun 2024 09:48:42 +0400 Subject: id: Start from 1 --- src/utils/id.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/utils') diff --git a/src/utils/id.rs b/src/utils/id.rs index 3f8a2a7d..06f48394 100644 --- a/src/utils/id.rs +++ b/src/utils/id.rs @@ -11,7 +11,9 @@ pub struct IdCounter { impl IdCounter { pub const fn new() -> Self { Self { - value: AtomicU32::new(0), + // Start from 1 to reduce the possibility that some other code that uses these IDs will + // get confused. + value: AtomicU32::new(1), } } -- cgit