File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -314,6 +314,13 @@ macro_rules! eprintln {
314
314
/// You can also use `dbg!()` without a value to just print the
315
315
/// file and line whenever it's reached.
316
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
+ ///
317
324
/// [stderr]: https://en.wikipedia.org/wiki/Standard_streams#Standard_error_(stderr)
318
325
/// [`debug!`]: https://docs.rs/log/*/log/macro.debug.html
319
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
You can’t perform that action at this time.
0 commit comments