From f23560f2446e2b397370e4063a13a0a10622bd42 Mon Sep 17 00:00:00 2001 From: Eunchong Yu Date: Mon, 17 Mar 2014 17:44:45 +0900 Subject: [PATCH] Follow the latest changes See also: - mozilla/rust#12791 - mozilla/rust#12756 - mozilla/rust#12896 --- src/mustache/mustache.rs | 1 - src/mustache/parser.rs | 14 +++++++------- src/mustache/test.rs | 9 +++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/mustache/mustache.rs b/src/mustache/mustache.rs index 7fee7ae..4bb4405 100644 --- a/src/mustache/mustache.rs +++ b/src/mustache/mustache.rs @@ -1,7 +1,6 @@ #[crate_id = "github.com/erickt/rust-mustache#mustache:0.1.0"]; extern crate std; -extern crate extra; extern crate serialize; extern crate collections; diff --git a/src/mustache/parser.rs b/src/mustache/parser.rs index 117df19..97045c2 100644 --- a/src/mustache/parser.rs +++ b/src/mustache/parser.rs @@ -416,13 +416,13 @@ impl<'a, T: Iterator> Parser<'a, T> { _ => { // If the name is "." then we want the top element, which we represent with // an empty name. - let name = match self.check_content(content) { - ~"." => ~[], - name => { - name.split_terminator('.') - .map(|x| x.to_owned()) - .collect() - } + let name = self.check_content(content); + let name = if name == ~"." { + ~[] + } else { + name.split_terminator('.') + .map(|x| x.to_owned()) + .collect() }; self.tokens.push(ETag(name, tag)); diff --git a/src/mustache/test.rs b/src/mustache/test.rs index 0e08c66..138e656 100644 --- a/src/mustache/test.rs +++ b/src/mustache/test.rs @@ -1,5 +1,7 @@ +#[feature(phase)]; +#[phase(syntax, link)] extern crate log; + extern crate mustache; -extern crate extra; extern crate serialize; extern crate collections; @@ -7,9 +9,8 @@ extern crate collections; mod test { use std::str; use collections::hashmap::HashMap; - use std::io::File; + use std::io::{File, TempDir}; use serialize::json; - use extra::tempfile; use serialize::Encodable; use mustache::{compile_str, render_str}; use mustache::{Context}; @@ -421,7 +422,7 @@ mod test { // Make a temporary dir where we'll store our partials. This is to // avoid a race on filenames. - let tmpdir = match tempfile::TempDir::new("") { + let tmpdir = match TempDir::new("") { Some(tmpdir) => tmpdir, None => fail!(), };