Skip to content

Commit

Permalink
feat: derive clone and equality traits.
Browse files Browse the repository at this point in the history
These will make testing easier.
  • Loading branch information
qwandor authored and hoodie committed Apr 10, 2022
1 parent 8e10529 commit 5d7a8a9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/components/date_time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::fmt;
/// In addition to readily implemented `FORM #1` and `FORM #2`, the RFC also specifies
/// `FORM #3: DATE WITH LOCAL TIME AND TIME ZONE REFERENCE`. This variant is not yet implemented.
/// Adding it will require adding support for `VTIMEZONE` and referencing it using `TZID`.
#[derive(Clone, Copy, Debug)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum CalendarDateTime {
/// `FORM #1: DATE WITH LOCAL TIME`: floating, follows current time-zone of the attendee.
///
Expand Down
12 changes: 6 additions & 6 deletions src/properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::{
mem,
};

#[derive(Debug, PartialEq, Eq)]
#[derive(Clone, Debug, PartialEq, Eq)]
/// key-value pairs inside of `Property`s
pub struct Parameter {
key: String,
Expand All @@ -24,7 +24,7 @@ impl Parameter {
//type EntryParameters = Vec<Parameter>;
pub type EntryParameters = HashMap<String, Parameter>;

#[derive(Debug, PartialEq, Eq)]
#[derive(Clone, Debug, PartialEq, Eq)]
/// key-value pairs inside of `Component`s
pub struct Property {
pub(crate) key: String,
Expand Down Expand Up @@ -95,7 +95,7 @@ impl Property {

/// This property defines the access classification for a calendar component.
/// <https://datatracker.ietf.org/doc/html/rfc5545#section-3.8.1.3>
#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub enum Class {
/// [`Public`](https://datatracker.ietf.org/doc/html/rfc5545#section-3.8.1.3)
Public,
Expand All @@ -120,7 +120,7 @@ impl From<Class> for Property {
}

/// see 8.3.4. [Value Data Types Registry](https://tools.ietf.org/html/rfc5545#section-8.3.4)
#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub enum ValueType {
/// [`Binary`](https://datatracker.ietf.org/doc/html/rfc5545#section-3.3.1)
Binary,
Expand Down Expand Up @@ -176,7 +176,7 @@ impl From<ValueType> for Parameter {
}
}

#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
/// Encodes the status of an `Event`
/// <https://datatracker.ietf.org/doc/html/rfc5545#section-3.8.1.11>
pub enum EventStatus {
Expand All @@ -189,7 +189,7 @@ pub enum EventStatus {
//Custom(&str)
}

#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
/// Encodes the status of a `Todo`
/// <https://datatracker.ietf.org/doc/html/rfc5545#section-3.8.1.11>
pub enum TodoStatus {
Expand Down

0 comments on commit 5d7a8a9

Please sign in to comment.