Make builder consuming

This commit is contained in:
Matthias Beyer 2017-12-03 18:41:21 +01:00
parent dc7a315176
commit 90a4139ede

View file

@ -162,22 +162,22 @@ pub mod builder {
impl HabitBuilder { impl HabitBuilder {
pub fn with_name(&mut self, name: String) -> &mut Self { pub fn with_name(mut self, name: String) -> Self {
self.name = Some(name); self.name = Some(name);
self self
} }
pub fn with_comment(&mut self, comment: String) -> &mut Self { pub fn with_comment(mut self, comment: String) -> Self {
self.comment = Some(comment); self.comment = Some(comment);
self self
} }
pub fn with_basedate(&mut self, date: NaiveDate) -> &mut Self { pub fn with_basedate(mut self, date: NaiveDate) -> Self {
self.basedate = Some(date); self.basedate = Some(date);
self self
} }
pub fn with_recurspec(&mut self, spec: String) -> &mut Self { pub fn with_recurspec(mut self, spec: String) -> Self {
self.recurspec = Some(spec); self.recurspec = Some(spec);
self self
} }