Skip to content

Commit f23560f

Browse files
committed
Follow the latest changes
See also: - rust-lang/rust#12791 - rust-lang/rust#12756 - rust-lang/rust#12896
1 parent 1955e10 commit f23560f

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/mustache/mustache.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#[crate_id = "github.com/erickt/rust-mustache#mustache:0.1.0"];
22

33
extern crate std;
4-
extern crate extra;
54
extern crate serialize;
65
extern crate collections;
76

src/mustache/parser.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -416,13 +416,13 @@ impl<'a, T: Iterator<char>> Parser<'a, T> {
416416
_ => {
417417
// If the name is "." then we want the top element, which we represent with
418418
// an empty name.
419-
let name = match self.check_content(content) {
420-
~"." => ~[],
421-
name => {
422-
name.split_terminator('.')
423-
.map(|x| x.to_owned())
424-
.collect()
425-
}
419+
let name = self.check_content(content);
420+
let name = if name == ~"." {
421+
~[]
422+
} else {
423+
name.split_terminator('.')
424+
.map(|x| x.to_owned())
425+
.collect()
426426
};
427427
428428
self.tokens.push(ETag(name, tag));

src/mustache/test.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1+
#[feature(phase)];
2+
#[phase(syntax, link)] extern crate log;
3+
14
extern crate mustache;
2-
extern crate extra;
35
extern crate serialize;
46
extern crate collections;
57

68
#[cfg(test)]
79
mod test {
810
use std::str;
911
use collections::hashmap::HashMap;
10-
use std::io::File;
12+
use std::io::{File, TempDir};
1113
use serialize::json;
12-
use extra::tempfile;
1314
use serialize::Encodable;
1415
use mustache::{compile_str, render_str};
1516
use mustache::{Context};
@@ -421,7 +422,7 @@ mod test {
421422

422423
// Make a temporary dir where we'll store our partials. This is to
423424
// avoid a race on filenames.
424-
let tmpdir = match tempfile::TempDir::new("") {
425+
let tmpdir = match TempDir::new("") {
425426
Some(tmpdir) => tmpdir,
426427
None => fail!(),
427428
};

0 commit comments

Comments
 (0)