mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-19 02:56:18 +00:00
refactor: standardize constant management and fix typos (#387)
* init rustfs config * init rustfs-utils crate * improve code for rustfs-config crate * add * improve code for comment * init rustfs config * improve code for rustfs-config crate * add * improve code for comment * Unified management of configurations and constants * fix: modify rustfs-config crate name * add default fn * improve code for rustfs config * refactor: standardize constant management and fix typos - Create centralized constants module for global static constants - Replace runtime format! expressions with compile-time constants - Fix DEFAULT_PORT reference issues in configuration arguments - Use const-str crate for compile-time string concatenation - Update tokio dependency from 1.42.2 to 1.45.0 - Ensure consistent naming convention for configuration constants * fix * Update common/workers/src/workers.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
/// Event configuration module
|
||||
pub struct EventConfig {
|
||||
pub event_type: String,
|
||||
pub event_source: String,
|
||||
pub event_destination: String,
|
||||
}
|
||||
|
||||
impl EventConfig {
|
||||
/// Creates a new instance of `EventConfig` with default values.
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
event_type: "default".to_string(),
|
||||
event_source: "default".to_string(),
|
||||
event_destination: "default".to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for EventConfig {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/// Event configuration module
|
||||
pub struct EventConfig {
|
||||
pub event_type: String,
|
||||
pub event_source: String,
|
||||
pub event_destination: String,
|
||||
}
|
||||
|
||||
impl EventConfig {
|
||||
/// Creates a new instance of `EventConfig` with default values.
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
event_type: "default".to_string(),
|
||||
event_source: "default".to_string(),
|
||||
event_destination: "default".to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
pub(crate) mod config;
|
||||
pub(crate) mod event;
|
||||
Reference in New Issue
Block a user