aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Rodney Hansen2021-11-28 16:40:33 +0000
committerIvan Tham2021-12-05 08:22:58 +0000
commitfebee2dc0c20cab360f75c2088c8f59b13a12e95 (patch)
treeb1c5b159790ceef839bb54071c20afa1d665bfc2
parent37e484ee38eb5a9b4da280960fb1e29939ee9d39 (diff)
No need to clone format
-rw-r--r--helix-core/src/increment/date_time.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/helix-core/src/increment/date_time.rs b/helix-core/src/increment/date_time.rs
index 39380104..195bc14b 100644
--- a/helix-core/src/increment/date_time.rs
+++ b/helix-core/src/increment/date_time.rs
@@ -13,7 +13,7 @@ use crate::{Range, Tendril};
pub struct DateTimeIncrementor {
date_time: NaiveDateTime,
range: Range,
- format: Format,
+ fmt: &'static str,
field: DateField,
}
@@ -97,7 +97,7 @@ impl DateTimeIncrementor {
Some(DateTimeIncrementor {
date_time,
range,
- format: format.clone(),
+ fmt: format.fmt,
field,
})
})
@@ -117,10 +117,7 @@ impl Increment for DateTimeIncrementor {
}
.unwrap_or(self.date_time);
- (
- self.range,
- date_time.format(self.format.fmt).to_string().into(),
- )
+ (self.range, date_time.format(self.fmt).to_string().into())
}
}