Skip to content

Commit

Permalink
you gotta do the cooking by the book / you know you can't be Lazy
Browse files Browse the repository at this point in the history
  • Loading branch information
gjcolombo committed Jun 5, 2024
1 parent a64cba5 commit 37aaa00
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions nexus/db-queries/src/db/queries/network_interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,26 @@ use uuid::Uuid;

// States an instance must be in to operate on its network interfaces, in
// most situations.
static INSTANCE_STOPPED: Lazy<db::model::InstanceState> =
Lazy::new(|| db::model::InstanceState::NoVmm);
const INSTANCE_STOPPED: db::model::InstanceState =
db::model::InstanceState::NoVmm;

static INSTANCE_FAILED: Lazy<db::model::InstanceState> =
Lazy::new(|| db::model::InstanceState::Failed);
const INSTANCE_FAILED: db::model::InstanceState =
db::model::InstanceState::Failed;

// An instance can be in the creating state while we manipulate its
// interfaces. The intention is for this only to be the case during sagas.
static INSTANCE_CREATING: Lazy<db::model::InstanceState> =
Lazy::new(|| db::model::InstanceState::Creating);
const INSTANCE_CREATING: db::model::InstanceState =
db::model::InstanceState::Creating;

// A sentinel value for the instance state when the instance actually does
// not exist.
static INSTANCE_DESTROYED: Lazy<db::model::InstanceState> =
Lazy::new(|| db::model::InstanceState::Destroyed);
const INSTANCE_DESTROYED: db::model::InstanceState =
db::model::InstanceState::Destroyed;

// A sentinel value for the instance state when the instance has an active
// VMM, irrespective of that VMM's actual state.
static INSTANCE_RUNNING: Lazy<db::model::InstanceState> =
Lazy::new(|| db::model::InstanceState::Vmm);
const INSTANCE_RUNNING: db::model::InstanceState =
db::model::InstanceState::Vmm;

static NO_INSTANCE_SENTINEL_STRING: Lazy<String> =
Lazy::new(|| String::from(NO_INSTANCE_SENTINEL));
Expand Down

0 comments on commit 37aaa00

Please sign in to comment.