mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-12 21:59:18 +00:00
traits1
This commit is contained in:
parent
b17295b36f
commit
2ffb454b12
@ -16,7 +16,11 @@ trait AppendBar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl AppendBar for String {
|
impl AppendBar for String {
|
||||||
//Add your code here
|
fn append_bar(self) -> Self {
|
||||||
|
let mut _string = self.clone();
|
||||||
|
_string.push_str("Bar");
|
||||||
|
return _string;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user