mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-12 05:54:51 +00:00
refactor: replace static with const for global constants (#5250)
This commit is contained in:
parent
5e7b30ac6a
commit
9e17c517fe
|
@ -76,7 +76,7 @@ use tracing::warn;
|
|||
use url::{ParseError, Url};
|
||||
use urlencoding::encode;
|
||||
|
||||
pub static AUTH_COOKIE_NAME: &str = "jwt";
|
||||
pub const AUTH_COOKIE_NAME: &str = "jwt";
|
||||
|
||||
#[tracing::instrument(skip_all)]
|
||||
pub async fn is_mod_or_admin(
|
||||
|
|
|
@ -44,9 +44,9 @@ const MAX_SUCCESSFULS: usize = 1000;
|
|||
|
||||
/// in prod mode, try to collect multiple send results at the same time to reduce load
|
||||
#[cfg(not(test))]
|
||||
static MIN_ACTIVITY_SEND_RESULTS_TO_HANDLE: usize = 4;
|
||||
const MIN_ACTIVITY_SEND_RESULTS_TO_HANDLE: usize = 4;
|
||||
#[cfg(test)]
|
||||
static MIN_ACTIVITY_SEND_RESULTS_TO_HANDLE: usize = 0;
|
||||
const MIN_ACTIVITY_SEND_RESULTS_TO_HANDLE: usize = 0;
|
||||
|
||||
///
|
||||
/// SendManager --(has many)--> InstanceWorker --(has many)--> SendRetryTask
|
||||
|
|
|
@ -10,7 +10,7 @@ pub mod structs;
|
|||
|
||||
use structs::{DatabaseConnection, PictrsConfig, PictrsImageMode, Settings};
|
||||
|
||||
static DEFAULT_CONFIG_FILE: &str = "config/config.hjson";
|
||||
const DEFAULT_CONFIG_FILE: &str = "config/config.hjson";
|
||||
|
||||
#[allow(clippy::expect_used)]
|
||||
pub static SETTINGS: LazyLock<Settings> = LazyLock::new(|| {
|
||||
|
|
Loading…
Reference in a new issue