• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

lennart-k / ical-rs / #73

12 Jan 2026 01:50PM UTC coverage: 77.771% (-0.03%) from 77.802%
#73

Pull #2

lennart-k
IcalCalendarObjectBuilder: Make attributes public
Pull Request #2: Major overhaul

908 of 1184 new or added lines in 30 files covered. (76.69%)

32 existing lines in 10 files now uncovered.

1221 of 1570 relevant lines covered (77.77%)

2.77 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

28.57
/src/types/mod.rs
1
mod duration;
2
pub use duration::*;
3
mod timezone;
4
use itertools::Itertools;
5
use rrule::{RRule, Unvalidated};
6
pub use timezone::*;
7
mod date;
8
mod period;
9
pub use date::*;
10
mod datetime;
11
pub use datetime::*;
12
mod dateordatetime;
13
pub use dateordatetime::*;
14
pub use period::*;
15
mod guess_timezone;
16
pub use guess_timezone::*;
17

18
mod vcard;
19
pub use vcard::*;
20

21
#[derive(Debug, thiserror::Error, PartialEq, Eq)]
22
pub enum CalDateTimeError {
23
    #[error(
24
        "Timezone has X-LIC-LOCATION property to specify a timezone from the Olson database, however its value {0} is invalid"
25
    )]
26
    InvalidOlson(String),
27
    #[error("TZID {0} does not refer to a valid timezone")]
28
    InvalidTZID(String),
29
    #[error("Timestamp doesn't exist because of gap in local time")]
30
    LocalTimeGap,
31
    #[error("Datetime string {0} has an invalid format")]
32
    InvalidDatetimeFormat(String),
33
    #[error("Could not parse datetime {0}")]
34
    ParseError(String),
35
    #[error("Duration string {0} has an invalid format")]
36
    InvalidDurationFormat(String),
37
    #[error("Invalid period format: {0}")]
38
    InvalidPeriodFormat(String),
39
}
40

41
pub trait Value: Sized {
NEW
42
    fn utc_or_local(self) -> Self {
×
NEW
43
        self
×
44
    }
45

46
    fn value_type(&self) -> Option<&'static str>;
47

48
    fn value(&self) -> String;
49
}
50

51
impl Value for String {
NEW
52
    fn value_type(&self) -> Option<&'static str> {
×
53
        Some("TEXT")
54
    }
55

NEW
56
    fn value(&self) -> String {
×
NEW
57
        self.to_owned()
×
58
    }
59
}
60

61
impl Value for RRule<Unvalidated> {
NEW
62
    fn value_type(&self) -> Option<&'static str> {
×
63
        Some("RECUR")
64
    }
65

NEW
66
    fn value(&self) -> String {
×
NEW
67
        self.to_string()
×
68
    }
69
}
70

71
impl<V: Value> Value for Vec<V> {
72
    fn value_type(&self) -> Option<&'static str> {
3✔
73
        self.first().and_then(Value::value_type)
3✔
74
    }
75

76
    fn value(&self) -> String {
4✔
77
        self.iter().map(Value::value).join(",")
4✔
78
    }
79

NEW
80
    fn utc_or_local(self) -> Self {
×
NEW
81
        self.into_iter().map(Value::utc_or_local).collect()
×
82
    }
83
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc