]> git.lizzy.rs Git - rust.git/blobdiff - src/libsyntax/ext/deriving/zero.rs
libsyntax: Mechanically change `~[T]` to `Vec<T>`
[rust.git] / src / libsyntax / ext / deriving / zero.rs
index 90f4fa0eb5897672ba83c557fd0d9241dfd4007e..9feae18689416c6c215a4a8fe5796669a94eddae 100644 (file)
@@ -21,16 +21,16 @@ pub fn expand_deriving_zero(cx: &mut ExtCtxt,
                             push: |@Item|) {
     let trait_def = TraitDef {
         span: span,
-        attributes: ~[],
-        path: Path::new(~["std", "num", "Zero"]),
-        additional_bounds: ~[],
+        attributes: Vec::new(),
+        path: Path::new(vec!("std", "num", "Zero")),
+        additional_bounds: Vec::new(),
         generics: LifetimeBounds::empty(),
-        methods: ~[
+        methods: vec!(
             MethodDef {
                 name: "zero",
                 generics: LifetimeBounds::empty(),
                 explicit_self: None,
-                args: ~[],
+                args: Vec::new(),
                 ret_ty: Self,
                 inline: true,
                 const_nonmatching: false,
@@ -40,8 +40,8 @@ pub fn expand_deriving_zero(cx: &mut ExtCtxt,
                 name: "is_zero",
                 generics: LifetimeBounds::empty(),
                 explicit_self: borrowed_explicit_self(),
-                args: ~[],
-                ret_ty: Literal(Path::new(~["bool"])),
+                args: Vec::new(),
+                ret_ty: Literal(Path::new(vec!("bool"))),
                 inline: true,
                 const_nonmatching: false,
                 combine_substructure: |cx, span, substr| {
@@ -52,19 +52,19 @@ pub fn expand_deriving_zero(cx: &mut ExtCtxt,
                            cx, span, substr)
                 }
             }
-        ]
+        )
     };
     trait_def.expand(cx, mitem, item, push)
 }
 
 fn zero_substructure(cx: &mut ExtCtxt, trait_span: Span, substr: &Substructure) -> @Expr {
-    let zero_ident = ~[
+    let zero_ident = vec!(
         cx.ident_of("std"),
         cx.ident_of("num"),
         cx.ident_of("Zero"),
         cx.ident_of("zero")
-    ];
-    let zero_call = |span| cx.expr_call_global(span, zero_ident.clone(), ~[]);
+    );
+    let zero_call = |span| cx.expr_call_global(span, zero_ident.clone(), Vec::new());
 
     return match *substr.fields {
         StaticStruct(_, ref summary) => {