state_pattern_types: Add reject method
This commit is contained in:
parent
4bd69ebbd8
commit
e89d22229f
1 changed files with 6 additions and 0 deletions
|
|
@ -23,6 +23,12 @@ impl DraftPost {
|
|||
}
|
||||
|
||||
impl PendingReviewPost {
|
||||
pub fn reject(self) -> DraftPost {
|
||||
DraftPost {
|
||||
content: self.content,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn approve(self) -> Post {
|
||||
Post {
|
||||
content: self.content,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue