mirror of
https://github.com/MercuryWorkshop/epoxy-tls.git
synced 2025-05-12 22:10:01 -04:00
fix builds without a config format & twisp
This commit is contained in:
parent
80c91c9381
commit
23b96c2073
2 changed files with 19 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
|||
use std::{collections::HashMap, ops::RangeInclusive, path::PathBuf};
|
||||
|
||||
use cfg_if::cfg_if;
|
||||
use clap::{Parser, ValueEnum};
|
||||
use lazy_static::lazy_static;
|
||||
use log::LevelFilter;
|
||||
|
@ -353,10 +354,9 @@ impl Config {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Eq, PartialEq, PartialOrd, Ord, Default, ValueEnum)]
|
||||
#[derive(Clone, Copy, Eq, PartialEq, PartialOrd, Ord, ValueEnum)]
|
||||
pub enum ConfigFormat {
|
||||
#[cfg(feature = "toml")]
|
||||
#[default]
|
||||
Toml,
|
||||
#[cfg(feature = "json")]
|
||||
Json,
|
||||
|
@ -364,6 +364,22 @@ pub enum ConfigFormat {
|
|||
Yaml,
|
||||
}
|
||||
|
||||
impl Default for ConfigFormat {
|
||||
fn default() -> Self {
|
||||
cfg_if! {
|
||||
if #[cfg(feature = "toml")] {
|
||||
return Self::Toml;
|
||||
} else if #[cfg(feature = "json")] {
|
||||
return Self::Json;
|
||||
} else if #[cfg(feature = "yaml")] {
|
||||
return Self::Yaml;
|
||||
} else {
|
||||
compile_error!("no config format feature enabled - build will fail!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Performant server implementation of the Wisp protocol in Rust, made for epoxy.
|
||||
#[derive(Parser)]
|
||||
#[command(version = clap::crate_version!())]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue