Update for changes

Signed-off-by: Walker Crouse <Walker.Crouse@coop.co.uk>
This commit is contained in:
Walker Crouse 2020-09-28 12:34:41 -04:00
parent 13a2a6c0e0
commit 35e5d00bb4
2 changed files with 3 additions and 7 deletions

View File

@ -73,17 +73,17 @@ impl BonjourTxtRecord {
} }
/// Returns a new `txt_record::Iter` for iterating over the record as you would a `HashMap`. /// Returns a new `txt_record::Iter` for iterating over the record as you would a `HashMap`.
pub fn iter(&self) -> Box<crate::txt_record::Iter> { pub fn iter<'a>(&'a self) -> Box<dyn Iterator<Item = (String, &'a str)> + 'a> {
Box::new(Iter::new(self)) Box::new(Iter::new(self))
} }
/// Returns a new `txt_record::Iter` over the records keys. /// Returns a new `txt_record::Iter` over the records keys.
pub fn keys(&self) -> Box<crate::txt_record::Keys> { pub fn keys<'a>(&'a self) -> Box<dyn Iterator<Item = String> + 'a> {
Box::new(Keys(Iter::new(self))) Box::new(Keys(Iter::new(self)))
} }
/// Returns a new `txt_record::Iter` over the records values. /// Returns a new `txt_record::Iter` over the records values.
pub fn values(&self) -> Box<crate::txt_record::Values> { pub fn values<'a>(&'a self) -> Box<dyn Iterator<Item = &'a str> + 'a> {
Box::new(Values(Iter::new(self))) Box::new(Values(Iter::new(self)))
} }

View File

@ -1,10 +1,6 @@
use crate::TxtRecord; use crate::TxtRecord;
use std::ops::Index; use std::ops::Index;
pub type Iter<'a> = dyn Iterator<Item = (String, &'a str)>;
pub type Keys<'a> = dyn Iterator<Item = String>;
pub type Values<'a> = dyn Iterator<Item = &'a str>;
impl Index<&str> for TxtRecord { impl Index<&str> for TxtRecord {
type Output = str; type Output = str;