aboutsummaryrefslogtreecommitdiff
path: root/crates/stdx/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-04-06 15:58:16 +0100
committerAleksey Kladov <[email protected]>2020-04-06 16:00:18 +0100
commitbf569f8b29d05782597d40ec98ee33bc2574763e (patch)
tree68a7af10960f55c5d4c1d2b50fea6a8c9f28e1d3 /crates/stdx/src
parent2603a9e628d304c8cb8fd08979e2f9c9afeac69e (diff)
Check for eprintln on CI
Diffstat (limited to 'crates/stdx/src')
-rw-r--r--crates/stdx/src/lib.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/crates/stdx/src/lib.rs b/crates/stdx/src/lib.rs
index d2efa2236..401a568bd 100644
--- a/crates/stdx/src/lib.rs
+++ b/crates/stdx/src/lib.rs
@@ -2,6 +2,21 @@
2 2
3use std::{cell::Cell, fmt}; 3use std::{cell::Cell, fmt};
4 4
5#[inline(always)]
6pub fn is_ci() -> bool {
7 option_env!("CI").is_some()
8}
9
10#[macro_export]
11macro_rules! eprintln {
12 ($($tt:tt)*) => {{
13 if $crate::is_ci() {
14 panic!("Forgot to remove debug-print?")
15 }
16 std::eprintln!($($tt)*)
17 }}
18}
19
5/// Appends formatted string to a `String`. 20/// Appends formatted string to a `String`.
6#[macro_export] 21#[macro_export]
7macro_rules! format_to { 22macro_rules! format_to {