Skip to content

Commit fecc749

Browse files
committed
feat: charming is now available with plot_charming
1 parent e43d9f5 commit fecc749

File tree

1 file changed

+53
-1
lines changed

1 file changed

+53
-1
lines changed

src/main.rs

+53-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use {
1717

1818
assert_one_feature!("discord_client", "console_client");
1919
assert_one_feature!("mongo_db", "memory_db");
20-
assert_one_feature!("plot_plotters", "plot_matplotlib");
20+
assert_one_feature!("plot_plotters", "plot_matplotlib", "plot_charming");
2121

2222
fn setup_sentry() -> Option<ClientInitGuard> {
2323
let Ok(sentry_dsn) = env_var("SENTRY_DSN") else {
@@ -75,6 +75,8 @@ async fn async_main() -> Result<()> {
7575
let plotter = plot::plotters::Plotters::new();
7676
#[cfg(feature = "plot_matplotlib")]
7777
let plotter = plot::plotters::Matplotlib::new();
78+
#[cfg(feature = "plot_charming")]
79+
let plotter = plot::charming::Charming::new();
7880

7981
let pgp_whitelist = env_var("PGP_SOURCE_DOMAIN_WHITELIST")?
8082
.split(',')
@@ -121,6 +123,56 @@ macro_rules! assert_one_feature {
121123
" feature."
122124
));
123125
};
126+
($a:literal, $b:literal, $c:literal) => {
127+
#[cfg(all(feature = $a, feature = $b, feature = $c))]
128+
compile_error!(concat!(
129+
"You can't enable both of ",
130+
$a,
131+
" and ",
132+
$b,
133+
" and ",
134+
$c,
135+
" feature at the same time."
136+
));
137+
138+
#[cfg(all(feature = $a, feature = $b))]
139+
compile_error!(concat!(
140+
"You can't enable both of ",
141+
$a,
142+
" and ",
143+
$b,
144+
" feature at the same time."
145+
));
146+
147+
#[cfg(all(feature = $b, feature = $c))]
148+
compile_error!(concat!(
149+
"You can't enable both of ",
150+
$b,
151+
" and ",
152+
$c,
153+
" feature at the same time."
154+
));
155+
156+
#[cfg(all(feature = $c, feature = $a))]
157+
compile_error!(concat!(
158+
"You can't enable both of ",
159+
$c,
160+
" and ",
161+
$a,
162+
" feature at the same time."
163+
));
164+
165+
#[cfg(not(any(feature = $a, feature = $b, feature = $c)))]
166+
compile_error!(concat!(
167+
"You must enable either ",
168+
$a,
169+
" or ",
170+
$b,
171+
" or ",
172+
$c,
173+
" feature."
174+
));
175+
};
124176
}
125177

126178
use assert_one_feature;

0 commit comments

Comments
 (0)