diff options
author | Hendrik Sollich <hendrik@hoodie.de> | 2017-02-19 02:02:37 +0100 |
---|---|---|
committer | Hendrik Sollich <hendrik@hoodie.de> | 2017-02-19 02:02:37 +0100 |
commit | 4feb36a8643d375305a3e87eda3697f12c1ee123 (patch) | |
tree | 1928b320849e6840b2258f0f60f95c00aa315d9f | |
parent | 88519a16daffc1694c765b96fd0b7a9510f0a615 (diff) |
added extend method
-rw-r--r-- | src/calendar.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/calendar.rs b/src/calendar.rs index 930107a..b904999 100644 --- a/src/calendar.rs +++ b/src/calendar.rs @@ -58,6 +58,13 @@ impl Calendar { self.components.append(&mut other.components); } + /// Extends this `Calendar` with the contends of another. + pub fn extend<T>(&mut self, other: T) + where T: IntoIterator<Item=CalendarElement> + { + self.components.extend(other); + } + /// Appends an element to the back of the `Calendar`. pub fn push<T:Into<CalendarElement>>(&mut self, component:T) -> &mut Self { self.components.push(component.into()); |