Skip to content

Commit 205a126

Browse files
committed
fix(prost-build): MSRV for Context
1 parent eba3137 commit 205a126

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

prost-build/src/context.rs

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,29 @@ impl<'a> Context<'a> {
4949

5050
/// Returns an iterator over the additional attributes configured
5151
/// for the named type.
52-
pub fn type_attributes(&self, fq_type_name: &str) -> path::Iter<'_, String> {
53-
self.config.type_attributes.get(fq_type_name)
52+
pub fn type_attributes(&self, fq_type_name: &str) -> impl Iterator<Item = &str> {
53+
self.config
54+
.type_attributes
55+
.get(fq_type_name)
56+
.map(|s| s.as_str())
5457
}
5558

5659
/// Returns an iterator over the additional attributes configured
5760
/// for the named message.
58-
pub fn message_attributes(&self, fq_message_name: &str) -> path::Iter<'_, String> {
59-
self.config.message_attributes.get(fq_message_name)
61+
pub fn message_attributes(&self, fq_message_name: &str) -> impl Iterator<Item = &str> {
62+
self.config
63+
.message_attributes
64+
.get(fq_message_name)
65+
.map(|s| s.as_str())
6066
}
6167

6268
/// Returns an iterator over the additional attributes configured
6369
/// for the named enum.
64-
pub fn enum_attributes(&self, fq_enum_name: &str) -> path::Iter<'_, String> {
65-
self.config.enum_attributes.get(fq_enum_name)
70+
pub fn enum_attributes(&self, fq_enum_name: &str) -> impl Iterator<Item = &str> {
71+
self.config
72+
.enum_attributes
73+
.get(fq_enum_name)
74+
.map(|s| s.as_str())
6675
}
6776

6877
/// Returns an iterator over the additional attributes configured

0 commit comments

Comments
 (0)