From 4f8c4720d4cb4463bafabdf7136e39e83471d87c Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Wed, 19 Jun 2019 06:27:31 -0700 Subject: [PATCH] change Revision to start from 1 --- src/runtime.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/runtime.rs b/src/runtime.rs index ed3b793e..3d27a712 100644 --- a/src/runtime.rs +++ b/src/runtime.rs @@ -453,8 +453,8 @@ impl Default for SharedState { next_id: AtomicUsize::new(1), storage: Default::default(), query_lock: Default::default(), - revision: Default::default(), - pending_revision: Default::default(), + revision: AtomicU64::new(1), + pending_revision: AtomicU64::new(1), dependency_graph: Default::default(), } } @@ -517,7 +517,7 @@ impl ActiveQuery { database_key, changed_at: ChangedAt { is_constant: true, - revision: Revision::ZERO, + revision: Revision::START, }, dependencies: Some(FxIndexSet::default()), } @@ -567,7 +567,7 @@ pub struct Revision { } impl Revision { - pub(crate) const ZERO: Self = Revision { generation: 0 }; + pub(crate) const START: Self = Revision { generation: 1 }; fn next(self) -> Revision { Revision {