From e89d22229f609190b6ea7c9603a06c3291082ad9 Mon Sep 17 00:00:00 2001 From: laurens Date: Sun, 11 Oct 2020 16:44:12 +0200 Subject: [PATCH] state_pattern_types: Add reject method --- state_pattern_types/src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/state_pattern_types/src/main.rs b/state_pattern_types/src/main.rs index 14ed679..4059d1d 100644 --- a/state_pattern_types/src/main.rs +++ b/state_pattern_types/src/main.rs @@ -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,