From 88fc7a2f2f021a4da38396b80bb0f680818dccaf Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Mon, 26 Dec 2022 10:05:56 -0800 Subject: [PATCH] Move templates into root module (#1090) --- src/main.rs | 4 +++- src/subcommand.rs | 2 +- src/subcommand/server.rs | 11 ++++------- src/{subcommand/server => }/templates.rs | 0 src/{subcommand/server => }/templates/block.rs | 0 src/{subcommand/server => }/templates/clock.rs | 0 src/{subcommand/server => }/templates/content.rs | 0 src/{subcommand/server => }/templates/home.rs | 0 src/{subcommand/server => }/templates/input.rs | 0 src/{subcommand/server => }/templates/inscription.rs | 0 src/{subcommand/server => }/templates/inscriptions.rs | 0 src/{subcommand/server => }/templates/output.rs | 0 src/{subcommand/server => }/templates/range.rs | 0 src/{subcommand/server => }/templates/rare.rs | 0 src/{subcommand/server => }/templates/sat.rs | 0 src/{subcommand/server => }/templates/transaction.rs | 0 16 files changed, 8 insertions(+), 9 deletions(-) rename src/{subcommand/server => }/templates.rs (100%) rename src/{subcommand/server => }/templates/block.rs (100%) rename src/{subcommand/server => }/templates/clock.rs (100%) rename src/{subcommand/server => }/templates/content.rs (100%) rename src/{subcommand/server => }/templates/home.rs (100%) rename src/{subcommand/server => }/templates/input.rs (100%) rename src/{subcommand/server => }/templates/inscription.rs (100%) rename src/{subcommand/server => }/templates/inscriptions.rs (100%) rename src/{subcommand/server => }/templates/output.rs (100%) rename src/{subcommand/server => }/templates/range.rs (100%) rename src/{subcommand/server => }/templates/rare.rs (100%) rename src/{subcommand/server => }/templates/sat.rs (100%) rename src/{subcommand/server => }/templates/transaction.rs (100%) diff --git a/src/main.rs b/src/main.rs index 93e7ed911a..41513dbf48 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,8 +25,9 @@ use { rarity::Rarity, sat::Sat, sat_point::SatPoint, - subcommand::{server::templates::ContentHtml, Subcommand}, + subcommand::Subcommand, tally::Tally, + templates::ContentHtml, }, anyhow::{anyhow, bail, Context, Error}, bitcoin::{ @@ -90,6 +91,7 @@ mod sat; mod sat_point; mod subcommand; mod tally; +mod templates; type Result = std::result::Result; diff --git a/src/subcommand.rs b/src/subcommand.rs index f5b6995374..2cea1ec096 100644 --- a/src/subcommand.rs +++ b/src/subcommand.rs @@ -6,7 +6,7 @@ mod index; mod info; mod list; mod parse; -pub(crate) mod server; +mod server; mod subsidy; mod supply; mod traits; diff --git a/src/subcommand/server.rs b/src/subcommand/server.rs index 92335f262e..2ecb0b9534 100644 --- a/src/subcommand/server.rs +++ b/src/subcommand/server.rs @@ -1,12 +1,10 @@ use super::*; use { - self::{ - deserialize_from_str::DeserializeFromStr, - templates::{ - BlockHtml, ClockSvg, HomeHtml, InputHtml, InscriptionHtml, InscriptionsHtml, OutputHtml, - PageContent, PageHtml, RangeHtml, RareTxt, SatHtml, TransactionHtml, - }, + self::deserialize_from_str::DeserializeFromStr, + crate::templates::{ + BlockHtml, ClockSvg, HomeHtml, InputHtml, InscriptionHtml, InscriptionsHtml, OutputHtml, + PageContent, PageHtml, RangeHtml, RareTxt, SatHtml, TransactionHtml, }, axum::{ body, @@ -30,7 +28,6 @@ use { }; mod deserialize_from_str; -pub(crate) mod templates; enum BlockQuery { Height(u64), diff --git a/src/subcommand/server/templates.rs b/src/templates.rs similarity index 100% rename from src/subcommand/server/templates.rs rename to src/templates.rs diff --git a/src/subcommand/server/templates/block.rs b/src/templates/block.rs similarity index 100% rename from src/subcommand/server/templates/block.rs rename to src/templates/block.rs diff --git a/src/subcommand/server/templates/clock.rs b/src/templates/clock.rs similarity index 100% rename from src/subcommand/server/templates/clock.rs rename to src/templates/clock.rs diff --git a/src/subcommand/server/templates/content.rs b/src/templates/content.rs similarity index 100% rename from src/subcommand/server/templates/content.rs rename to src/templates/content.rs diff --git a/src/subcommand/server/templates/home.rs b/src/templates/home.rs similarity index 100% rename from src/subcommand/server/templates/home.rs rename to src/templates/home.rs diff --git a/src/subcommand/server/templates/input.rs b/src/templates/input.rs similarity index 100% rename from src/subcommand/server/templates/input.rs rename to src/templates/input.rs diff --git a/src/subcommand/server/templates/inscription.rs b/src/templates/inscription.rs similarity index 100% rename from src/subcommand/server/templates/inscription.rs rename to src/templates/inscription.rs diff --git a/src/subcommand/server/templates/inscriptions.rs b/src/templates/inscriptions.rs similarity index 100% rename from src/subcommand/server/templates/inscriptions.rs rename to src/templates/inscriptions.rs diff --git a/src/subcommand/server/templates/output.rs b/src/templates/output.rs similarity index 100% rename from src/subcommand/server/templates/output.rs rename to src/templates/output.rs diff --git a/src/subcommand/server/templates/range.rs b/src/templates/range.rs similarity index 100% rename from src/subcommand/server/templates/range.rs rename to src/templates/range.rs diff --git a/src/subcommand/server/templates/rare.rs b/src/templates/rare.rs similarity index 100% rename from src/subcommand/server/templates/rare.rs rename to src/templates/rare.rs diff --git a/src/subcommand/server/templates/sat.rs b/src/templates/sat.rs similarity index 100% rename from src/subcommand/server/templates/sat.rs rename to src/templates/sat.rs diff --git a/src/subcommand/server/templates/transaction.rs b/src/templates/transaction.rs similarity index 100% rename from src/subcommand/server/templates/transaction.rs rename to src/templates/transaction.rs