diff options
author | Michael Muré <batolettre@gmail.com> | 2018-07-25 21:25:26 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-07-25 21:27:50 +0200 |
commit | 6706fa2bebcf5e1ff7001dbe82a9d79fa33ac096 (patch) | |
tree | ca346f24125a2d6b13d10f06dd8ddc06b6a30917 /bug/operations/set_title.go | |
parent | 78355c887a9cc1b058a1bbc6ff38df54e34a96b4 (diff) | |
download | git-bug-6706fa2bebcf5e1ff7001dbe82a9d79fa33ac096.tar.gz |
some cleaning
Diffstat (limited to 'bug/operations/set_title.go')
-rw-r--r-- | bug/operations/set_title.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/bug/operations/set_title.go b/bug/operations/set_title.go index 295db282..fab01d8a 100644 --- a/bug/operations/set_title.go +++ b/bug/operations/set_title.go @@ -13,6 +13,12 @@ type SetTitleOperation struct { Title string } +func (op SetTitleOperation) Apply(snapshot bug.Snapshot) bug.Snapshot { + snapshot.Title = op.Title + + return snapshot +} + func NewSetTitleOp(author bug.Person, title string) SetTitleOperation { return SetTitleOperation{ OpBase: bug.NewOpBase(bug.SetTitleOp, author), @@ -20,12 +26,7 @@ func NewSetTitleOp(author bug.Person, title string) SetTitleOperation { } } -func (op SetTitleOperation) Apply(snapshot bug.Snapshot) bug.Snapshot { - snapshot.Title = op.Title - - return snapshot -} - +// Convenience function to apply the operation func SetTitle(b *bug.Bug, author bug.Person, title string) { setTitleOp := NewSetTitleOp(author, title) b.Append(setTitleOp) |