aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-10-29 20:46:29 -0500
committerAlex Crichton <alex@alexcrichton.com>2014-10-29 20:46:29 -0500
commit35804927ef76cc5f24b04f2af25919c488a0992c (patch)
treefd834a4d6350b4b90f2a56bfebc7cfb84715ba34 /src
parenta8f96a60c2dd0b88a67976dc3919aaf587f3d2c9 (diff)
parent334b30bb3d9f5aa0814ab326c429b712768bb2d4 (diff)
downloadmilf-rs-35804927ef76cc5f24b04f2af25919c488a0992c.tar.gz
milf-rs-35804927ef76cc5f24b04f2af25919c488a0992c.zip
Merge pull request #24 from steveklabnik/master
fail -> panic
Diffstat (limited to 'src')
-rw-r--r--src/serialization.rs18
-rw-r--r--src/show.rs2
2 files changed, 10 insertions, 10 deletions
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<Error> 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<Error> 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<DecodeError> for Decoder {
-> Result<T, DecodeError>)
-> Result<T, DecodeError>
{
- fail!()
+ panic!()
}
fn read_enum_struct_variant_field<T>(&mut self,
_f_name: &str,
@@ -532,7 +532,7 @@ impl serialize::Decoder<DecodeError> for Decoder {
-> Result<T, DecodeError>)
-> Result<T, DecodeError>
{
- fail!()
+ panic!()
}
fn read_struct<T>(&mut self, _s_name: &str, _len: uint,
@@ -595,14 +595,14 @@ impl serialize::Decoder<DecodeError> for Decoder {
_f: |&mut Decoder, uint| -> Result<T, DecodeError>)
-> Result<T, DecodeError>
{
- fail!()
+ panic!()
}
fn read_tuple_struct_arg<T>(&mut self,
_a_idx: uint,
_f: |&mut Decoder| -> Result<T, DecodeError>)
-> Result<T, DecodeError>
{
- fail!()
+ panic!()
}
// Specialized types:
@@ -1000,7 +1000,7 @@ mod tests {
}));
let a: Result<Foo, DecodeError> = 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<Foo, DecodeError> = 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();