Skip to content

Commit 1e8a58f

Browse files
committed
finish traits2
1 parent acbf9dc commit 1e8a58f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

exercises/traits/traits2.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,15 @@ trait AppendBar {
1515
}
1616

1717
// TODO: Implement trait `AppendBar` for a vector of strings.
18-
19-
#[cfg(test)]
18+
impl AppendBar for Vec<String>
19+
{
20+
fn append_bar(mut self) -> Self
21+
{
22+
self.push(String::from("Bar"));
23+
return self
24+
}
25+
}
26+
#[cfg(test)]
2027
mod tests {
2128
use super::*;
2229

0 commit comments

Comments
 (0)