From e4c26af5a7d55daea203bb276abe1b3ff392f04d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Israel=20Pe=C3=B1a?= Date: Sat, 21 Feb 2015 00:05:08 -0800 Subject: [PATCH] rename RingBuf to VecDeque --- src/context.rs | 6 +++--- src/template.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/context.rs b/src/context.rs index 9647c9daa..e6a73b689 100644 --- a/src/context.rs +++ b/src/context.rs @@ -2,7 +2,7 @@ use std::num::Float; use serialize::json::{Json, ToJson}; use regex::Regex; use std::iter::IteratorExt; -use std::collections::RingBuf; +use std::collections::VecDeque; pub struct Context { data: Json, @@ -13,7 +13,7 @@ pub struct Context { static ARRAY_INDEX_MATCHER: Regex = regex!(r"\[\d+\]$"); #[inline] -fn parse_json_visitor<'a>(path_stack: &mut RingBuf<&'a str>, path: &'a String) { +fn parse_json_visitor<'a>(path_stack: &mut VecDeque<&'a str>, path: &'a String) { for p in (*path).split('/') { match p { "this" | "." | "" => { @@ -49,7 +49,7 @@ impl Context { } pub fn navigate(&self, path: &String, relative_path: &String) -> &Json { - let mut path_stack :RingBuf<&str> = RingBuf::new(); + let mut path_stack :VecDeque<&str> = VecDeque::new(); parse_json_visitor(&mut path_stack, path); parse_json_visitor(&mut path_stack, relative_path); diff --git a/src/template.rs b/src/template.rs index fab0fe174..aba20639a 100644 --- a/src/template.rs +++ b/src/template.rs @@ -3,7 +3,7 @@ use std::ops::BitOr; use std::num::FromPrimitive; use std::fmt::{self, Debug, Formatter}; use std::iter::IteratorExt; -use std::collections::{BTreeMap, RingBuf}; +use std::collections::{BTreeMap, VecDeque}; use std::string::ToString; use serialize::json::Json; @@ -186,8 +186,8 @@ fn process_whitespace(buf: &String, wso: &mut WhiteSpaceOmit) -> String { impl Template { pub fn compile(source: String) -> Result { - let mut helper_stack: RingBuf = RingBuf::new(); - let mut template_stack: RingBuf