Skip to content

Commit

Permalink
Follow the latest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kroisse committed Mar 17, 2014
1 parent 1955e10 commit f23560f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
1 change: 0 additions & 1 deletion src/mustache/mustache.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
14 changes: 7 additions & 7 deletions src/mustache/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,13 +416,13 @@ impl<'a, T: Iterator<char>> 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));
Expand Down
9 changes: 5 additions & 4 deletions src/mustache/test.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#[feature(phase)];
#[phase(syntax, link)] extern crate log;

extern crate mustache;
extern crate extra;
extern crate serialize;
extern crate collections;

#[cfg(test)]
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};
Expand Down Expand Up @@ -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!(),
};
Expand Down

0 comments on commit f23560f

Please sign in to comment.