feat: traits done

This commit is contained in:
2026-09-11 17:37:48 +02:00
parent b94cdfd4c4
commit 8ded4cc8b5
5 changed files with 14 additions and 3 deletions
+6
View File
@@ -4,6 +4,12 @@ trait AppendBar {
// TODO: Implement the trait `AppendBar` for a vector of strings.
// `append_bar` should push the string "Bar" into the vector.
impl AppendBar for Vec<String> {
fn append_bar(mut self) -> Self {
self.push(String::from("Bar"));
self
}
}
fn main() {
// You can optionally experiment here.