aboutsummaryrefslogtreecommitdiffstats
path: root/src/config/mod.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-31 04:57:36 +0100
committertv <tv@krebsco.de>2026-10-31 04:57:36 +0100
commit41d50380caebf8cb723e1eda8d866fed2b9ff1c1 (patch)
tree4c9dce3dd5ecbe38148a8e992fb95bd49a56c1e4 /src/config/mod.rs
parent7c148c95c22a9852f46f05d3ee887335c53721d1 (diff)
move mycelium settings to mycelium module
Diffstat (limited to 'src/config/mod.rs')
-rw-r--r--src/config/mod.rs35
1 files changed, 3 insertions, 32 deletions
diff --git a/src/config/mod.rs b/src/config/mod.rs
index b82ad9b..4afb0bb 100644
--- a/src/config/mod.rs
+++ b/src/config/mod.rs
@@ -567,35 +567,6 @@ fn default_mycelium_peers() -> Vec<String> {
}
impl Settings {
- /// `mycelium-rest-url`, parsed (checked when loading).
- #[cfg_attr(not(feature = "mycelium"), allow(dead_code))]
- pub(crate) fn mycelium_rest_url(&self) -> Option<url::Url> {
- self.mycelium_rest_url
- .as_deref()
- .and_then(|url| url::Url::parse(url).ok())
- }
-
- /// The options only a supervised Mycelium daemon takes, and whether each is set: the
- /// other side of `CONFLICTS`' `mycelium-rest-url` (a test keeps them the same).
- #[cfg_attr(not(any(feature = "mycelium", test)), allow(dead_code))]
- pub(crate) fn supervised_only(&self) -> [(&'static str, bool); 4] {
- [
- ("mycelium-key-file", self.mycelium_key_file.is_some()),
- (
- "mycelium-network-key-file",
- self.mycelium_network_key_file.is_some(),
- ),
- (
- "mycelium-network-name",
- self.mycelium_network_name.is_some(),
- ),
- (
- "mycelium-tcp-listen-port",
- self.mycelium_tcp_listen_port.is_some(),
- ),
- ]
- }
-
fn check(&self) -> Result<()> {
if crate::logging::LogFormat::parse(&self.log_format).is_none() {
bail!(
@@ -1659,7 +1630,8 @@ mod tests {
assert_eq!(named("tor"), None);
}
- /// `Settings::check` and the override rule name the same supervised-only options.
+ /// Mycelium's check and the override rule name the same supervised-only options.
+ #[cfg(feature = "mycelium")]
#[test]
fn supervised_only_options_are_the_conflicts() {
let settings = resolve(
@@ -1668,8 +1640,7 @@ mod tests {
)
.unwrap()
.settings;
- let names: Vec<&str> = settings
- .supervised_only()
+ let names: Vec<&str> = crate::transport::mycelium::supervised_only(&settings)
.iter()
.map(|(name, _)| *name)
.collect();