• 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

46.67
/src/parser/ical/component/alarm.rs
1
use crate::{
2
    PropertyParser,
3
    parser::{Component, ComponentMut, ParserError},
4
    property::ContentLine,
5
};
6
use std::{
7
    collections::{HashMap, HashSet},
8
    io::BufRead,
9
};
10

11
#[derive(Debug, Clone, Default)]
12
pub struct IcalAlarmBuilder {
13
    pub properties: Vec<ContentLine>,
14
}
15

16
#[derive(Debug, Clone)]
17
pub struct IcalAlarm {
18
    pub properties: Vec<ContentLine>,
19
}
20

21
impl IcalAlarmBuilder {
22
    pub fn new() -> Self {
2✔
23
        Self {
24
            properties: Vec::new(),
2✔
25
        }
26
    }
27
}
28

29
impl Component for IcalAlarmBuilder {
30
    const NAMES: &[&str] = &["VALARM"];
31
    type Unverified = IcalAlarmBuilder;
32

NEW
33
    fn get_properties(&self) -> &Vec<ContentLine> {
×
34
        &self.properties
35
    }
36

NEW
37
    fn mutable(self) -> Self::Unverified {
×
NEW
38
        self
×
39
    }
40
}
41

42
impl Component for IcalAlarm {
43
    const NAMES: &[&str] = &["VALARM"];
44
    type Unverified = IcalAlarmBuilder;
45

46
    fn get_properties(&self) -> &Vec<ContentLine> {
1✔
47
        &self.properties
48
    }
49

50
    fn mutable(self) -> Self::Unverified {
×
51
        IcalAlarmBuilder {
52
            properties: self.properties,
×
53
        }
54
    }
55
}
56

57
impl ComponentMut for IcalAlarmBuilder {
58
    type Verified = IcalAlarm;
59

60
    fn get_properties_mut(&mut self) -> &mut Vec<ContentLine> {
2✔
61
        &mut self.properties
62
    }
63

64
    #[cfg(not(tarpaulin_include))]
65
    fn add_sub_component<B: BufRead>(
66
        &mut self,
67
        value: &str,
68
        _: &mut PropertyParser<B>,
69
    ) -> Result<(), ParserError> {
70
        Err(ParserError::InvalidComponent(value.to_owned()))
71
    }
72

73
    fn build(
2✔
74
        self,
75
        _timezones: Option<&HashMap<String, Option<chrono_tz::Tz>>>,
76
    ) -> Result<IcalAlarm, ParserError> {
77
        Ok(IcalAlarm {
2✔
78
            properties: self.properties,
2✔
79
        })
80
    }
81
}
82

83
impl IcalAlarm {
NEW
84
    pub fn get_tzids(&self) -> HashSet<&str> {
×
UNCOV
85
        self.properties
×
86
            .iter()
NEW
87
            .filter_map(|prop| prop.params.get_tzid())
×
88
            .collect()
89
    }
90
}
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