Implement AppendBar trait for String type

This commit is contained in:
Rock070 2024-01-02 23:56:12 +08:00
parent 7e523787e1
commit 6d67fc122f

View File

@ -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() {