From 350c9d269a4ad8332c4d91a5042a625d944f64fc Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Thu, 30 Oct 2014 00:26:24 -0400 Subject: [PATCH] fail -> panic --- examples/example1.rs | 2 +- examples/example2.rs | 2 +- examples/example3.rs | 2 +- src/axes_common.rs | 6 +++--- src/figure.rs | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/example1.rs b/examples/example1.rs index f8e60b0e..a714ac3a 100644 --- a/examples/example1.rs +++ b/examples/example1.rs @@ -149,7 +149,7 @@ fn main() let matches = match getopts(args.tail(), opts) { Ok(m) => m, - Err(f) => fail!("{}", f) + Err(f) => panic!("{}", f) }; if matches.opt_present("h") { diff --git a/examples/example2.rs b/examples/example2.rs index fbf31078..5dcaf6b7 100644 --- a/examples/example2.rs +++ b/examples/example2.rs @@ -141,7 +141,7 @@ fn main() let matches = match getopts(args.tail(), opts) { Ok(m) => m, - Err(f) => fail!("{}", f) + Err(f) => panic!("{}", f) }; if matches.opt_present("h") { diff --git a/examples/example3.rs b/examples/example3.rs index f9b53db3..48be59ea 100644 --- a/examples/example3.rs +++ b/examples/example3.rs @@ -100,7 +100,7 @@ fn main() let matches = match getopts(args.tail(), opts) { Ok(m) => m, - Err(f) => fail!("{}", f) + Err(f) => panic!("{}", f) }; if matches.opt_present("h") { diff --git a/src/axes_common.rs b/src/axes_common.rs index 37582438..a1e87edb 100644 --- a/src/axes_common.rs +++ b/src/axes_common.rs @@ -480,7 +480,7 @@ impl AxisData { if incr <= 0.0 { - fail!("'incr' must be positive, but is actually {}", incr); + panic!("'incr' must be positive, but is actually {}", incr); } c.write_str(" "); write!(&mut *c, " {:.12e}", incr); @@ -541,7 +541,7 @@ pub fn char_to_symbol(c: char) -> i32 'D' => 11, 'r' => 12, 'R' => 13, - a => fail!("Invalid symbol {}", a) + a => panic!("Invalid symbol {}", a) } } @@ -911,7 +911,7 @@ impl AxesCommonData ZLabel => "zlabel", TitleLabel => "title", Label(..) => "label", - _ => fail!("Invalid label type") + _ => panic!("Invalid label type") }; c.write_str(label_str); diff --git a/src/figure.rs b/src/figure.rs index 3682f146..92f9253b 100644 --- a/src/figure.rs +++ b/src/figure.rs @@ -83,7 +83,7 @@ impl Figure match self.axes.as_mut_slice()[l - 1] { Axes2DType(ref mut a) => a, - _ => fail!() + _ => panic!() } } @@ -95,7 +95,7 @@ impl Figure match self.axes.as_mut_slice()[l - 1] { Axes3DType(ref mut a) => a, - _ => fail!() + _ => panic!() } }