We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
dbg!(..)
1 parent 3750348 commit 8816a9aCopy full SHA for 8816a9a
src/libstd/macros.rs
@@ -314,6 +314,13 @@ macro_rules! eprintln {
314
/// You can also use `dbg!()` without a value to just print the
315
/// file and line whenever it's reached.
316
///
317
+/// Finally, if you want to `dbg!(..)` multiple values, it will treat them as
318
+/// a tuple (and return it, too):
319
+///
320
+/// ```
321
+/// assert_eq!(dbg!(1usize, 2u32), (1, 2));
322
323
324
/// [stderr]: https://en.wikipedia.org/wiki/Standard_streams#Standard_error_(stderr)
325
/// [`debug!`]: https://docs.rs/log/*/log/macro.debug.html
326
/// [`log`]: https://crates.io/crates/log
@@ -333,6 +340,9 @@ macro_rules! dbg {
333
340
tmp
334
341
}
335
342
343
+ };
344
+ ($val:expr, $($more:expr),+) => {
345
+ dbg!(($val, $($more),*))
336
346
337
347
338
348
0 commit comments