]> git.lizzy.rs Git - rust.git/blobdiff - src/libsyntax/ext/deriving/hash.rs
libsyntax: Mechanically change `~[T]` to `Vec<T>`
[rust.git] / src / libsyntax / ext / deriving / hash.rs
index acae4f9efa6160114a0dd663d2eb50fcebb9d621..ed7f61d5e94218a6ffcac03fd5c83b06a4215366 100644 (file)
@@ -22,23 +22,23 @@ pub fn expand_deriving_hash(cx: &mut ExtCtxt,
 
     let hash_trait_def = TraitDef {
         span: span,
-        attributes: ~[],
-        path: Path::new(~["std", "hash", "Hash"]),
-        additional_bounds: ~[],
+        attributes: Vec::new(),
+        path: Path::new(vec!("std", "hash", "Hash")),
+        additional_bounds: Vec::new(),
         generics: LifetimeBounds::empty(),
-        methods: ~[
+        methods: vec!(
             MethodDef {
                 name: "hash",
                 generics: LifetimeBounds::empty(),
                 explicit_self: borrowed_explicit_self(),
-                args: ~[Ptr(~Literal(Path::new(~["std", "hash", "sip", "SipState"])),
-                            Borrowed(None, MutMutable))],
+                args: vec!(Ptr(~Literal(Path::new(vec!("std", "hash", "sip", "SipState"))),
+                            Borrowed(None, MutMutable))),
                 ret_ty: nil_ty(),
                 inline: true,
                 const_nonmatching: false,
                 combine_substructure: hash_substructure
             }
-        ]
+        )
     };
 
     hash_trait_def.expand(cx, mitem, item, push);
@@ -51,10 +51,10 @@ fn hash_substructure(cx: &mut ExtCtxt, trait_span: Span, substr: &Substructure)
     };
     let hash_ident = substr.method_ident;
     let call_hash = |span, thing_expr| {
-        let expr = cx.expr_method_call(span, thing_expr, hash_ident, ~[state_expr]);
+        let expr = cx.expr_method_call(span, thing_expr, hash_ident, vec!(state_expr));
         cx.stmt_expr(expr)
     };
-    let mut stmts = ~[];
+    let mut stmts = Vec::new();
 
     let fields = match *substr.fields {
         Struct(ref fs) => fs,