otoxteam / web_ical

web_ical is an esay iCalendar Rust library. It’s goals are to read and write ics web files (Google Calendar, Airbnb Calendar and more) data in a developer-friendly way.
MIT License
15 stars 11 forks source link

SEQUENCE should be of type i32, not u32 #7

Open edgarogh opened 2 years ago

edgarogh commented 2 years ago

In lib.rs, line 75, the field sequence of the structure Events is declared as u32.

However;

Section 3.8.7.4 of RFC5545 says:

Property Name: SEQUENCE [...] Value Type: INTEGER

Section 3.3.8 of RFC5545 (Property Value Data Types > Integer) mentions:

The valid range for "integer" is -2147483648 to 2147483647

...which in Rust corresponds to i32.

This causes the parsing of some of my calendars to fail when it shouldn't. I can send a micro-PR if you don't have the time to work on this.

edgarogh commented 2 years ago

Feel free to integrate edgarogh/web_ical@817894a24afd873f669db5bc23156b9cb7132d69.