• 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

85.71
/src/parser/property/version.rs
1
use crate::{
2
    parser::{ParseProp, ParserError},
3
    property::ContentLine,
4
    types::Value,
5
};
6
use std::collections::HashMap;
7

8
#[derive(Debug, Clone, PartialEq, Eq)]
9
pub enum IcalVersion {
10
    Version1_0,
11
    Version2_0,
12
}
13

14
impl Value for IcalVersion {
15
    fn value_type(&self) -> Option<&'static str> {
1✔
16
        Some("TEXT")
17
    }
18

19
    fn value(&self) -> String {
1✔
20
        match self {
1✔
NEW
21
            Self::Version1_0 => "1.0".to_owned(),
×
22
            Self::Version2_0 => "2.0".to_owned(),
1✔
23
        }
24
    }
25
}
26

27
impl ParseProp for IcalVersion {
28
    fn parse_prop(
1✔
29
        prop: &ContentLine,
30
        _timezones: Option<&HashMap<String, Option<chrono_tz::Tz>>>,
31
        _default_type: &str,
32
    ) -> Result<Self, ParserError> {
33
        match prop
2✔
34
            .value
35
            .as_deref()
1✔
36
            .unwrap_or_default()
1✔
37
            .to_uppercase()
1✔
38
            .as_str()
1✔
39
        {
40
            "1.0" => Ok(Self::Version1_0),
1✔
41
            "2.0" => Ok(Self::Version2_0),
3✔
NEW
42
            _ => Err(ParserError::InvalidVersion),
×
43
        }
44
    }
45
}
46
super::property!("VERSION", "TEXT", IcalVERSIONProperty, IcalVersion);
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