From 8941557da6bfa50c5664b19be830baefb981fc20 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Wed, 27 Dec 2017 19:09:36 -0800 Subject: [PATCH] add parameter container iterator --- src/param.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/param.rs b/src/param.rs index 1244a2ab..b2e7c602 100644 --- a/src/param.rs +++ b/src/param.rs @@ -2,6 +2,7 @@ use std; use std::ops::Index; use std::path::PathBuf; use std::str::FromStr; +use std::slice::Iter; use std::borrow::Cow; use smallvec::SmallVec; @@ -77,6 +78,11 @@ impl<'a> Params<'a> { T::from_param("") } } + + /// Return iterator to items in paramter container + pub fn iter(&self) -> Iter<(Cow<'a, str>, Cow<'a, str>)> { + self.0.iter() + } } impl<'a, 'b, 'c: 'a> Index<&'b str> for &'c Params<'a> {