mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Move stdx macros into submodule
This commit is contained in:
parent
4b1c372436
commit
6b4cf5b7d8
2 changed files with 21 additions and 19 deletions
19
crates/stdx/src/macros.rs
Normal file
19
crates/stdx/src/macros.rs
Normal file
|
@ -0,0 +1,19 @@
|
|||
//! Convenience macros.
|
||||
#[macro_export]
|
||||
macro_rules! eprintln {
|
||||
($($tt:tt)*) => {{
|
||||
if $crate::is_ci() {
|
||||
panic!("Forgot to remove debug-print?")
|
||||
}
|
||||
std::eprintln!($($tt)*)
|
||||
}}
|
||||
}
|
||||
|
||||
/// Appends formatted string to a `String`.
|
||||
#[macro_export]
|
||||
macro_rules! format_to {
|
||||
($buf:expr) => ();
|
||||
($buf:expr, $lit:literal $($arg:tt)*) => {
|
||||
{ use ::std::fmt::Write as _; let _ = ::std::write!($buf, $lit $($arg)*); }
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue