mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-04 01:39:18 +00:00
Implement AppendBar trait for String type
This commit is contained in:
parent
7e523787e1
commit
6d67fc122f
@ -15,6 +15,11 @@ trait AppendBar {
|
||||
|
||||
impl AppendBar for String {
|
||||
// TODO: Implement `AppendBar` for type `String`.
|
||||
fn append_bar(self) -> String {
|
||||
let str = self.to_string().push_str("Bar");
|
||||
|
||||
str
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user