diff --git a/Cargo.toml b/Cargo.toml index a1b9091..d3bbd44 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ authors = ["RakuJa"] # Compiler info edition = "2021" -rust-version = "1.75.0" +rust-version = "1.79.0" description = "Beyond Your Bestiary Explorer (BYBE) is a web service that provides tools to help Pathfinder 2e Game Masters." readme = "README.md" @@ -39,8 +39,8 @@ sqlx = { version = "0.8.2", features = ["runtime-async-std", "sqlite"] } cached = { version = "0.54.0", features = ["async"] } anyhow = "1.0.93" -serde = { version = "1.0.214", features = ["derive"] } -serde_json = "1.0.132" +serde = { version = "1.0.215", features = ["derive"] } +serde_json = "1.0.133" strum = {version="0.26.3", features = ["derive"]} fastrand = "2.2.0" counter = "0.6.0" @@ -56,6 +56,7 @@ dotenvy = "0.15.7" env_logger = "0.11.5" log = "0.4.22" once_cell = "1.20.2" +once = "0.3.4" [build-dependencies] tokio = { version = "1", features = ["macros", "rt-multi-thread", "rt"] } diff --git a/src/db/cr_core_initializer.rs b/src/db/cr_core_initializer.rs index 4076d8e..a4c5c60 100644 --- a/src/db/cr_core_initializer.rs +++ b/src/db/cr_core_initializer.rs @@ -9,12 +9,14 @@ use crate::models::creature::creature_metadata::type_enum::CreatureTypeEnum; use crate::models::shared::rarity_enum::RarityEnum; use crate::models::shared::size_enum::SizeEnum; use anyhow::{bail, Result}; +use once::assert_has_not_been_called; use serde::{Deserialize, Serialize}; use sqlx::{FromRow, Pool, Sqlite}; -/// Handler for startup, first creature_core initialization. Then it shouldn't be used - pub async fn update_creature_core_table(conn: &Pool) -> Result<()> { + assert_has_not_been_called!( + "Handler for startup, first creature_core initialization. Then it shouldn't be used" + ); let scales = fetch_creature_scales(conn).await?; for cr in get_creatures_raw_essential_data(conn, 0, -1).await? { let traits = fetch_creature_traits(conn, cr.id).await?;