This repository was archived by the owner on Dec 2, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
77
88- Adds a feature to work around JLink quirks
99- Adds a dbg! macro using heprintln
10+ - Now Rust 2018 edition
1011
1112## [ v0.3.4] - 2019-04-22
1213
Original file line number Diff line number Diff line change 129129//! `dbg!` returns a given expression and prints it using `heprintln!` including context
130130//! for quick and dirty debugging.
131131//!
132+ //! Panics if `heprintln!` returns an error.
133+ //!
132134//! Example:
133135//!
134136//! ```
Original file line number Diff line number Diff line change @@ -88,19 +88,20 @@ macro_rules! heprintln {
8888
8989/// Macro that prints and returns the value of a given expression
9090/// for quick and dirty debugging. Works exactly like `dbg!` in
91- /// the standard library, replacing `eprintln` with `heprintln`.
91+ /// the standard library, replacing `eprintln` with `heprintln`,
92+ /// which it unwraps.
9293#[ macro_export]
9394macro_rules! dbg {
9495 ( ) => {
95- $crate:: hprintln !( "[{}:{}]" , file!( ) , line!( ) ) ;
96+ $crate:: heprintln !( "[{}:{}]" , file!( ) , line!( ) ) . unwrap ( ) ;
9697 } ;
9798 ( $val: expr) => {
9899 // Use of `match` here is intentional because it affects the lifetimes
99100 // of temporaries - https://stackoverflow.com/a/48732525/1063961
100101 match $val {
101102 tmp => {
102- $crate:: hprintln !( "[{}:{}] {} = {:#?}" ,
103- file!( ) , line!( ) , stringify!( $val) , & tmp) ;
103+ $crate:: heprintln !( "[{}:{}] {} = {:#?}" ,
104+ file!( ) , line!( ) , stringify!( $val) , & tmp) . unwrap ( ) ;
104105 tmp
105106 }
106107 }
You can’t perform that action at this time.
0 commit comments