Skip to content

Commit

Permalink
add README and LICENSE
Browse files Browse the repository at this point in the history
  • Loading branch information
djzin committed Feb 11, 2017
1 parent c4f643e commit 1958927
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 16 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
target
Cargo.lock
*.swp
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
name = "parse-zoneinfo"
version = "0.1.0"
authors = ["Djzin <[email protected]>"]
description = "Parse zoneinfo files from the IANA database"
keywords = ["date", "time", "timezone", "zone", "calendar"]
repository = "https://github.com/djzin/parse-zoneinfo"
readme = "README.md"
license = "MIT"

[dependencies]
regex = "^0.1"
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Copyright (c) 2017 Djzin

The MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# parse-zoneinfo

Parse-zoneinfo is a fork of [`zoneinfo_parse`][zoneinfo_parse], with adjustments such that it no longer depends on the `Datetime` crate. It is used by [`chrono-tz`][chrono_tz].

[zoneinfo_parse]: https://github.com/rust-datetime/zoneinfo-parse
[chrono_tz]: https://github.com/djzin/chrono-tz
Binary file removed src/.lib.rs.swp
Binary file not shown.
32 changes: 16 additions & 16 deletions src/line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,22 @@ pub struct LineParser {
empty_line: Regex,
}

#[derive(PartialEq, Debug, Clone)]
pub enum Error {
FailedYearParse(String),
FailedMonthParse(String),
FailedWeekdayParse(String),
InvalidLineType(String),
TypeColumnContainedNonHyphen(String),
CouldNotParseSaving(String),
InvalidDaySpec(String),
InvalidTimeSpecAndType(String),
NonWallClockInTimeSpec(String),
NotParsedAsRuleLine,
NotParsedAsZoneLine,
NotParsedAsLinkLine,
}

impl LineParser {
pub fn new() -> Self {
LineParser {
Expand Down Expand Up @@ -147,22 +163,6 @@ impl Month {
}
}

#[derive(PartialEq, Debug, Clone)]
pub enum Error {
FailedYearParse(String),
FailedMonthParse(String),
FailedWeekdayParse(String),
InvalidLineType(String),
TypeColumnContainedNonHyphen(String),
CouldNotParseSaving(String),
InvalidDaySpec(String),
InvalidTimeSpecAndType(String),
NonWallClockInTimeSpec(String),
NotParsedAsRuleLine,
NotParsedAsZoneLine,
NotParsedAsLinkLine,
}

impl FromStr for Month {
type Err = Error;

Expand Down

0 comments on commit 1958927

Please sign in to comment.