1
1
#[ doc = include_str ! ( "print.md" ) ]
2
2
#[ cfg( feature = "auto" ) ]
3
+ #[ cfg( feature = "test" ) ]
3
4
#[ macro_export]
4
5
macro_rules! print {
5
6
( $( $arg: tt) * ) => { {
6
- if cfg!( any( feature = "test" , test) ) {
7
+ let target_stream = std:: io:: stdout( ) ;
8
+ let buffer = $crate:: _macros:: to_adapted_string( & format_args!( $( $arg) * ) , & target_stream) ;
9
+ :: std:: print!( "{}" , buffer)
10
+ } } ;
11
+ }
12
+
13
+ #[ doc = include_str ! ( "print.md" ) ]
14
+ #[ cfg( feature = "auto" ) ]
15
+ #[ cfg( not( feature = "test" ) ) ]
16
+ #[ macro_export]
17
+ macro_rules! print {
18
+ ( $( $arg: tt) * ) => { {
19
+ if cfg!( test) {
7
20
let target_stream = std:: io:: stdout( ) ;
8
21
let buffer = $crate:: _macros:: to_adapted_string( & format_args!( $( $arg) * ) , & target_stream) ;
9
22
:: std:: print!( "{}" , buffer)
@@ -23,13 +36,29 @@ macro_rules! print {
23
36
24
37
#[ doc = include_str ! ( "println.md" ) ]
25
38
#[ cfg( feature = "auto" ) ]
39
+ #[ cfg( feature = "test" ) ]
40
+ #[ macro_export]
41
+ macro_rules! println {
42
+ ( ) => {
43
+ $crate:: print!( "\n " )
44
+ } ;
45
+ ( $( $arg: tt) * ) => { {
46
+ let target_stream = std:: io:: stdout( ) ;
47
+ let buffer = $crate:: _macros:: to_adapted_string( & format_args!( $( $arg) * ) , & target_stream) ;
48
+ :: std:: println!( "{}" , buffer)
49
+ } } ;
50
+ }
51
+
52
+ #[ doc = include_str ! ( "println.md" ) ]
53
+ #[ cfg( feature = "auto" ) ]
54
+ #[ cfg( not( feature = "test" ) ) ]
26
55
#[ macro_export]
27
56
macro_rules! println {
28
57
( ) => {
29
58
$crate:: print!( "\n " )
30
59
} ;
31
60
( $( $arg: tt) * ) => { {
32
- if cfg!( any ( feature = " test" , test ) ) {
61
+ if cfg!( test) {
33
62
let target_stream = std:: io:: stdout( ) ;
34
63
let buffer = $crate:: _macros:: to_adapted_string( & format_args!( $( $arg) * ) , & target_stream) ;
35
64
:: std:: println!( "{}" , buffer)
@@ -49,10 +78,23 @@ macro_rules! println {
49
78
50
79
#[ doc = include_str ! ( "eprint.md" ) ]
51
80
#[ cfg( feature = "auto" ) ]
81
+ #[ cfg( feature = "test" ) ]
82
+ #[ macro_export]
83
+ macro_rules! eprint {
84
+ ( $( $arg: tt) * ) => { {
85
+ let target_stream = std:: io:: stderr( ) ;
86
+ let buffer = $crate:: _macros:: to_adapted_string( & format_args!( $( $arg) * ) , & target_stream) ;
87
+ :: std:: eprint!( "{}" , buffer)
88
+ } } ;
89
+ }
90
+
91
+ #[ doc = include_str ! ( "eprint.md" ) ]
92
+ #[ cfg( feature = "auto" ) ]
93
+ #[ cfg( not( feature = "test" ) ) ]
52
94
#[ macro_export]
53
95
macro_rules! eprint {
54
96
( $( $arg: tt) * ) => { {
55
- if cfg!( any ( feature = " test" , test ) ) {
97
+ if cfg!( test) {
56
98
let target_stream = std:: io:: stderr( ) ;
57
99
let buffer = $crate:: _macros:: to_adapted_string( & format_args!( $( $arg) * ) , & target_stream) ;
58
100
:: std:: eprint!( "{}" , buffer)
@@ -72,13 +114,29 @@ macro_rules! eprint {
72
114
73
115
#[ doc = include_str ! ( "eprintln.md" ) ]
74
116
#[ cfg( feature = "auto" ) ]
117
+ #[ cfg( feature = "test" ) ]
118
+ #[ macro_export]
119
+ macro_rules! eprintln {
120
+ ( ) => {
121
+ $crate:: eprint!( "\n " )
122
+ } ;
123
+ ( $( $arg: tt) * ) => { {
124
+ let target_stream = std:: io:: stderr( ) ;
125
+ let buffer = $crate:: _macros:: to_adapted_string( & format_args!( $( $arg) * ) , & target_stream) ;
126
+ :: std:: eprintln!( "{}" , buffer)
127
+ } } ;
128
+ }
129
+
130
+ #[ doc = include_str ! ( "eprintln.md" ) ]
131
+ #[ cfg( feature = "auto" ) ]
132
+ #[ cfg( not( feature = "test" ) ) ]
75
133
#[ macro_export]
76
134
macro_rules! eprintln {
77
135
( ) => {
78
136
$crate:: eprint!( "\n " )
79
137
} ;
80
138
( $( $arg: tt) * ) => { {
81
- if cfg!( any ( feature = " test" , test ) ) {
139
+ if cfg!( test) {
82
140
let target_stream = std:: io:: stderr( ) ;
83
141
let buffer = $crate:: _macros:: to_adapted_string( & format_args!( $( $arg) * ) , & target_stream) ;
84
142
:: std:: eprintln!( "{}" , buffer)
0 commit comments