From 334b30bb3d9f5aa0814ab326c429b712768bb2d4 Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Wed, 29 Oct 2014 21:45:18 -0400 Subject: fail -> panic --- src/serialization.rs | 18 +++++++++--------- src/show.rs | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/serialization.rs b/src/serialization.rs index 706e26c..2573f5f 100644 --- a/src/serialization.rs +++ b/src/serialization.rs @@ -217,13 +217,13 @@ impl serialize::Encoder for Encoder { _f: |&mut Encoder| -> Result<(), Error>) -> Result<(), Error> { - fail!() + panic!() } fn emit_enum_struct_variant_field(&mut self, _f_name: &str, _f_idx: uint, _f: |&mut Encoder| -> Result<(), Error>) -> Result<(), Error> { - fail!() + panic!() } fn emit_struct(&mut self, _name: &str, _len: uint, f: |&mut Encoder| -> Result<(), Error>) -> Result<(), Error> { @@ -290,7 +290,7 @@ impl serialize::Encoder for Encoder { match mem::replace(&mut self.state, Start) { Start => unreachable!(), NextKey(_) => Ok(()), - NextArray(..) => fail!("how to encode None in an array?"), + NextArray(..) => panic!("how to encode None in an array?"), NextMapKey => Err(InvalidMapKeyLocation), } } @@ -523,7 +523,7 @@ impl serialize::Decoder for Decoder { -> Result) -> Result { - fail!() + panic!() } fn read_enum_struct_variant_field(&mut self, _f_name: &str, @@ -532,7 +532,7 @@ impl serialize::Decoder for Decoder { -> Result) -> Result { - fail!() + panic!() } fn read_struct(&mut self, _s_name: &str, _len: uint, @@ -595,14 +595,14 @@ impl serialize::Decoder for Decoder { _f: |&mut Decoder, uint| -> Result) -> Result { - fail!() + panic!() } fn read_tuple_struct_arg(&mut self, _a_idx: uint, _f: |&mut Decoder| -> Result) -> Result { - fail!() + panic!() } // Specialized types: @@ -1000,7 +1000,7 @@ mod tests { })); let a: Result = Decodable::decode(&mut d); match a { - Ok(..) => fail!("should not have decoded"), + Ok(..) => panic!("should not have decoded"), Err(e) => { assert_eq!(e.to_string().as_slice(), "expected a value of type `integer`, but \ @@ -1018,7 +1018,7 @@ mod tests { })); let a: Result = Decodable::decode(&mut d); match a { - Ok(..) => fail!("should not have decoded"), + Ok(..) => panic!("should not have decoded"), Err(e) => { assert_eq!(e.to_string().as_slice(), "expected a value of type `integer` for the key `bar`"); diff --git a/src/show.rs b/src/show.rs index 3499eff..27733ed 100644 --- a/src/show.rs +++ b/src/show.rs @@ -85,7 +85,7 @@ impl<'a, 'b> Printer<'a, 'b> { self.stack.connect("."))); match *inner { Table(ref inner) => try!(self.print(inner)), - _ => fail!("non-heterogeneous toml array"), + _ => panic!("non-heterogeneous toml array"), } } self.stack.pop(); -- cgit v1.2.3