From b64704592bbb3d87118a3ea6b96e52a72d9c8eab Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Thu, 31 Oct 2024 23:03:29 -0700 Subject: [PATCH] More pr comments --- src/attribute.rs | 14 ++++++++------ src/recipe.rs | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/attribute.rs b/src/attribute.rs index fd41aa270c..52d8ef8707 100644 --- a/src/attribute.rs +++ b/src/attribute.rs @@ -1,3 +1,5 @@ +use std::collections::{self}; + use super::*; #[derive( @@ -136,14 +138,14 @@ impl<'src> Display for Attribute<'src> { #[derive(Default, Debug, Clone, PartialEq, Serialize)] pub(crate) struct AttributeSet<'src>(BTreeSet>); -impl<'src> IntoIterator for &AttributeSet<'src> { - type Item = &'src Attribute<'src>; +impl<'src, 'a> IntoIterator for &'a AttributeSet<'src> { + type Item = &'a Attribute<'src>; - type IntoIter; + type IntoIter = collections::btree_set::Iter<'a, Attribute<'src>>; - fn into_iter(self) -> Self::IntoIter { - todo!() - } + fn into_iter(self) -> Self::IntoIter { + self.0.iter() + } } impl<'src> AttributeSet<'src> { diff --git a/src/recipe.rs b/src/recipe.rs index ad0f2e9c21..e2d477bd0f 100644 --- a/src/recipe.rs +++ b/src/recipe.rs @@ -483,7 +483,7 @@ impl<'src, D: Display> ColorDisplay for Recipe<'src, D> { writeln!(f, "# {doc}")?; } - for attribute in self.attributes.iter() { + for attribute in &self.attributes { writeln!(f, "[{attribute}]")?; }