diff options
| author | Björn Steinbrink <bsteinbr@gmail.com> | 2013-05-06 00:18:51 +0200 |
|---|---|---|
| committer | Björn Steinbrink <bsteinbr@gmail.com> | 2013-05-14 16:36:23 +0200 |
| commit | bdc182cc41c2741edc6fdc4ec09b8522479aab40 (patch) | |
| tree | e4d26bbc1b47702ef46cd01bbaa5b5dad8633416 /src/libsyntax/ext/auto_encode.rs | |
| parent | 84745b483f322671f894b9e8d0a462c46275a9d3 (diff) | |
| download | rust-bdc182cc41c2741edc6fdc4ec09b8522479aab40.tar.gz rust-bdc182cc41c2741edc6fdc4ec09b8522479aab40.zip | |
Use static string with fail!() and remove fail!(fmt!())
fail!() used to require owned strings but can handle static strings now. Also, it can pass its arguments to fmt!() on its own, no need for the caller to call fmt!() itself.
Diffstat (limited to 'src/libsyntax/ext/auto_encode.rs')
| -rw-r--r-- | src/libsyntax/ext/auto_encode.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsyntax/ext/auto_encode.rs b/src/libsyntax/ext/auto_encode.rs index e1416230720..9b78d9954d3 100644 --- a/src/libsyntax/ext/auto_encode.rs +++ b/src/libsyntax/ext/auto_encode.rs @@ -917,7 +917,7 @@ fn mk_struct_fields(fields: &[@ast::struct_field]) -> ~[field] { do fields.map |field| { let ident = match field.node.kind { ast::named_field(ident, _) => ident, - _ => fail!(~"[auto_encode] does not support unnamed fields") + _ => fail!("[auto_encode] does not support unnamed fields") }; field { @@ -1056,7 +1056,7 @@ fn mk_enum_ser_body( /*bad*/ copy *args ), ast::struct_variant_kind(*) => - fail!(~"struct variants unimplemented"), + fail!("struct variants unimplemented"), } }; @@ -1151,7 +1151,7 @@ fn mk_enum_deser_body( } }, ast::struct_variant_kind(*) => - fail!(~"struct variants unimplemented"), + fail!("struct variants unimplemented"), }; let pat = @ast::pat { |
