Skip to content

Commit 31198f5

Browse files
committed
Switch to $(,)? in tri macro
The $(...)? operation is supported since Rust 1.32.
1 parent 51df12e commit 31198f5

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

‎src/lib.rs‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -410,15 +410,12 @@ pub use crate::value::{from_value, to_value, Map, Number, Value};
410410
// We only use our own error type; no need for From conversions provided by the
411411
// standard library's try! macro. This reduces lines of LLVM IR by 4%.
412412
macro_rules! tri {
413-
($e:expr) => {
413+
($e:expr $(,)?) => {
414414
match $e {
415415
crate::lib::Result::Ok(val) => val,
416416
crate::lib::Result::Err(err) => return crate::lib::Result::Err(err),
417417
}
418418
};
419-
($e:expr,) => {
420-
tri!($e)
421-
};
422419
}
423420

424421
#[macro_use]

0 commit comments

Comments
 (0)