From db98e7c9e682711d1f5b96f0d2218b5b5021ae8a Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Fri, 6 Jan 2023 00:23:26 -0500 Subject: [PATCH] Fix release mode compilation condition --- src/activitypub/inbox.rs | 2 +- src/activitypub/mod.rs | 2 +- src/generator/css.rs | 2 +- src/main.rs | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/activitypub/inbox.rs b/src/activitypub/inbox.rs index e12fffc..4491e66 100644 --- a/src/activitypub/inbox.rs +++ b/src/activitypub/inbox.rs @@ -267,7 +267,7 @@ async fn send_accept( Ok(()) } -const ACCEPT_NON_PUBLIC_NOTES: bool = !cfg!(release); +const ACCEPT_NON_PUBLIC_NOTES: bool = !cfg!(debug_assertions); async fn handle_create_note( _create: AcceptedActivity, diff --git a/src/activitypub/mod.rs b/src/activitypub/mod.rs index a1f3469..47774d5 100644 --- a/src/activitypub/mod.rs +++ b/src/activitypub/mod.rs @@ -53,7 +53,7 @@ pub fn conversation_context() -> AnyBase { .unwrap() } -const ACCEPT_INVALID_CERTS: bool = !cfg!(release); +const ACCEPT_INVALID_CERTS: bool = !cfg!(debug_assertions); pub static CLIENT: Lazy = Lazy::new(|| { if ACCEPT_INVALID_CERTS { warn!("Accepting invalid certs for ActivityPub request"); diff --git a/src/generator/css.rs b/src/generator/css.rs index 4ce3f6e..fe21ad9 100644 --- a/src/generator/css.rs +++ b/src/generator/css.rs @@ -7,7 +7,7 @@ const CHARSET: &'static str = r#"@charset "UTF-8";"#; pub fn generate() -> anyhow::Result<()> { let format = Format { - style: if cfg!(release) { + style: if cfg!(debug_assertions) { Style::Compressed } else { Style::Expanded diff --git a/src/main.rs b/src/main.rs index f0128b2..e0cbbdd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -42,7 +42,7 @@ async fn main() { ) .get_matches(); - if cfg!(release) { + if cfg!(debug_assertions) { info!("Running in release mode"); } else { info!("Running in dev mode"); @@ -76,7 +76,7 @@ async fn main() { }); let sched = JobScheduler::new().await.expect("create JobScheduler"); - let digest_schedule = if cfg!(release) { + let digest_schedule = if cfg!(debug_assertions) { // every day at midnight utc "0 0 0 * * * *" } else {