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