Add a method for mutating blog post texts
This commit is contained in:
parent
f924172cb4
commit
c2e1f27302
1 changed files with 4 additions and 0 deletions
|
@ -10,6 +10,10 @@ impl Post {
|
||||||
content: String::new(),
|
content: String::new(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn add_text(&mut self, text: &str) {
|
||||||
|
self.content.push_str(text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
trait State {}
|
trait State {}
|
||||||
|
|
Loading…
Reference in a new issue