Skip to content

Commit f788f81

Browse files
SimonRastikianSimonRastikian
authored andcommitted
&Vec<Participant> to &[Participant]
Return type should be &[Participant] instead of &Vec to provide a more flexible API that doesn't expose the underlying container type.
1 parent 426feab commit f788f81

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/participants.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ impl ParticipantList {
110110
}
111111

112112
// Returns all the participants in the list
113-
pub fn participants(&self) -> &Vec<Participant> {
114-
&self.participants
113+
pub fn participants(&self) -> &[Participant] {
114+
self.participants.as_slice()
115115
}
116116
}
117117

@@ -188,7 +188,7 @@ impl<'a, T> ParticipantMap<'a, T> {
188188
}
189189

190190
// Returns the set of included participants
191-
pub fn participants(&self) -> &Vec<Participant> {
191+
pub fn participants(&self) -> &[Participant] {
192192
self.participants.participants()
193193
}
194194
}

0 commit comments

Comments
 (0)