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 {
314314/// You can also use `dbg!()` without a value to just print the
315315/// file and line whenever it's reached.
316316///
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+ ///
317324/// [stderr]: https://en.wikipedia.org/wiki/Standard_streams#Standard_error_(stderr)
318325/// [`debug!`]: https://docs.rs/log/*/log/macro.debug.html
319326/// [`log`]: https://crates.io/crates/log
@@ -333,6 +340,9 @@ macro_rules! dbg {
333340 tmp
334341 }
335342 }
343+ } ;
344+ ( $val: expr, $( $more: expr) ,+) => {
345+ dbg!( ( $val, $( $more) ,* ) )
336346 }
337347}
338348
You can’t perform that action at this time.
0 commit comments