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 {
pub fn with_name(&mut self, name: String) -> &mut Self {
pub fn with_name(mut self, name: String) -> Self {
self.name = Some(name);
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
}
pub fn with_basedate(&mut self, date: NaiveDate) -> &mut Self {
pub fn with_basedate(mut self, date: NaiveDate) -> Self {
self.basedate = Some(date);
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
}