Skip to content

Commit 79e7596

Browse files
author
developerworks
committed
Upgrade rust-config-tree to 0.2.5 with ConfigSchema derive support
- Bump rust-config-tree dependency from 0.2.3 to 0.2.5 - Switch ConfigSchema import to top-level re-export path - Replace manual ConfigSchema impl with derive macro
1 parent a94dd01 commit 79e7596

3 files changed

Lines changed: 31 additions & 19 deletions

File tree

Cargo.lock

Lines changed: 14 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ name = "rust-tokio-supervisor"
3737
path = "src/main.rs"
3838

3939
[dependencies]
40-
rust-config-tree = "0.2.3"
40+
rust-config-tree = "0.2.5"
4141
clap = { version = "4.6.1", features = ["derive"] }
4242
confique = { version = "0.4.0", features = ["yaml"] }
4343
figment = { version = "0.10.19", features = ["yaml", "toml", "json"] }

src/config/configurable.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//! YAML loading, template rendering, and JSON Schema generation.
55
66
use confique::Config;
7-
use rust_config_tree::config::ConfigSchema;
7+
use rust_config_tree::ConfigSchema;
88
use schemars::JsonSchema;
99
use serde::{Deserialize, Serialize};
1010
use std::path::PathBuf;
@@ -26,7 +26,7 @@ use crate::{
2626
};
2727

2828
/// Configuration file shape loaded from YAML.
29-
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Config, JsonSchema)]
29+
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Config, JsonSchema, ConfigSchema)]
3030
pub struct SupervisorConfig {
3131
/// Additional configuration files included by `rust-config-tree`.
3232
#[config(default = [])]
@@ -98,20 +98,20 @@ pub struct SupervisorConfig {
9898
pub children: ChildrenConfigSection,
9999
}
100100

101-
impl ConfigSchema for SupervisorConfig {
102-
/// Returns child configuration paths declared by one loaded layer.
103-
///
104-
/// # Arguments
105-
///
106-
/// - `layer`: Partially loaded supervisor configuration layer.
107-
///
108-
/// # Returns
109-
///
110-
/// Returns include paths declared by this configuration layer.
111-
fn include_paths(layer: &<Self as Config>::Layer) -> Vec<PathBuf> {
112-
layer.include.clone().unwrap_or_default()
113-
}
114-
}
101+
// impl ConfigSchema for SupervisorConfig {
102+
// /// Returns child configuration paths declared by one loaded layer.
103+
// ///
104+
// /// # Arguments
105+
// ///
106+
// /// - `layer`: Partially loaded supervisor configuration layer.
107+
// ///
108+
// /// # Returns
109+
// ///
110+
// /// Returns include paths declared by this configuration layer.
111+
// fn include_paths(layer: &<Self as Config>::Layer) -> Vec<PathBuf> {
112+
// layer.include.clone().unwrap_or_default()
113+
// }
114+
// }
115115

116116
/// Root supervisor configuration.
117117
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Config, JsonSchema)]

0 commit comments

Comments
 (0)