From ece8a8f520697be50cbe543bebe065c5198dae4d Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 29 Jan 2014 16:33:57 -0800 Subject: std: Remove io::io_error * All I/O now returns IoResult = Result * All formatting traits now return fmt::Result = IoResult<()> * The if_ok!() macro was added to libstd --- src/libstd/macros.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/libstd/macros.rs') diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs index 4032b63790b..b31ae92d742 100644 --- a/src/libstd/macros.rs +++ b/src/libstd/macros.rs @@ -197,3 +197,8 @@ macro_rules! local_data_key ( pub static $name: ::std::local_data::Key<$ty> = &::std::local_data::Key; ) ) + +#[macro_export] +macro_rules! if_ok ( + ($e:expr) => (match $e { Ok(e) => e, Err(e) => return Err(e) }) +) -- cgit 1.4.1-3-g733a5