Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
Kijewski committed Dec 30, 2023
1 parent 8e81041 commit 1dc2516
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 36 deletions.
15 changes: 0 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,21 +189,6 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}

package:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
toolchain: stable

- run: cargo package --workspace

devskim:
name: DevSkim
runs-on: ubuntu-20.04
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tzdb"
version = "0.6.1-pre.1"
version = "0.6.1"
edition = "2018"
authors = ["René Kijewski <crates.io@k6i.de>"]
repository = "https://github.com/Kijewski/tzdb"
Expand All @@ -13,7 +13,7 @@ readme = "README.md"

[dependencies]
iana-time-zone = { version = "^0.1.50", default-features = false, features = ["fallback"], optional = true }
tzdb_data = { version = "0.1.0-pre.1", default-features = false, path = "tzdb_data" }
tzdb_data = { version = "^0.1.0", default-features = false, path = "tzdb_data" }
tz-rs = { version = "^0.6.14", default-features = false, features = ["const", "std"] }

[features]
Expand Down
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@

Static time zone information for [tz-rs](https://crates.io/crates/tz-rs).

This crate provides all time zones found in the [Time Zone Database](https://www.iana.org/time-zones),
currently in the version 2023d (released 2023-12-22).

See the documentation for a full list the the contained time zones:
<https://docs.rs/tzdb/latest/tzdb/time_zone/index.html>
This crate provides all time zones found in the [Time Zone Database](https://www.iana.org/time-zones).

## Usage examples

Expand All @@ -29,7 +25,7 @@ let current_time = tzdb::now::in_named("Europe/Berlin")?;

// names are case insensitive
let time_zone = tzdb::tz_by_name("ArCtIc/LongYeArByEn")?;
let current_time = tzdb::now::in_named("ArCtIc/LongYeArByEn")?;
let current_time = tzdb::now::in_named("ArCtIc/LoNgYeArByEn")?;

// provide a default time zone
let current_time = tzdb::now::local_or(tzdb::time_zone::GMT)?;
Expand Down
13 changes: 3 additions & 10 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,7 @@
//!
//! Static time zone information for [tz-rs](https://crates.io/crates/tz-rs).
//!
//! This crate provides all time zones found in the [Time Zone Database](https://www.iana.org/time-zones),
//! currently in the version 2023d (released 2023-12-22).
//!
//! See the documentation for a full list the the contained time zones:
//! <https://docs.rs/tzdb/latest/tzdb/time_zone/index.html>
//! This crate provides all time zones found in the [Time Zone Database](https://www.iana.org/time-zones).
//!
//! ## Usage examples
//!
Expand All @@ -66,8 +62,8 @@
//! let current_time = tzdb::now::in_named("Europe/Berlin").unwrap();
//!
//! // names are case insensitive
//! let time_zone = tzdb::tz_by_name("ArCtIc/LongYeArByEn").unwrap();
//! let current_time = tzdb::now::in_named("ArCtIc/LongYeArByEn").unwrap();
//! let time_zone = tzdb::tz_by_name("ArCtIc/LoNgYeArByEn").unwrap();
//! let current_time = tzdb::now::in_named("ArCtIc/LoNgYeArByEn").unwrap();
//!
//! // provide a default time zone
//! # #[cfg(feature = "local")] {
Expand All @@ -81,9 +77,6 @@
//! * `local` <sup>(enabled by default)</sup> — enable functions to query the current system time
//!

#[cfg(docsrs)]
extern crate alloc;

#[cfg(docsrs)]
pub mod changelog;
pub mod now;
Expand Down
2 changes: 1 addition & 1 deletion tzdb_data/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tzdb_data"
version = "0.1.0-pre.1"
version = "0.1.0"
edition = "2018"
authors = ["René Kijewski <crates.io@k6i.de>"]
repository = "https://github.com/Kijewski/tzdb"
Expand Down
18 changes: 18 additions & 0 deletions tzdb_data/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
# tzdb_data — Time Zone Database

[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/Kijewski/tzdb/ci.yml?branch=v0.6.x)](https://github.com/Kijewski/tzdb/actions/workflows/ci.yml)
[![Crates.io](https://img.shields.io/crates/v/tzdb?logo=rust)](https://crates.io/crates/tzdb)
![Minimum supported Rust version](https://img.shields.io/badge/rustc-1.56+-important?logo=rust "Minimum Supported Rust Version: 1.56")
[![License: MIT-0](https://img.shields.io/badge/license-MIT--0-informational?logo=apache)](/LICENSE.md "License: MIT-0")

Static, `#![no_std]` time zone information for tz-rs

## Usage examples

```rust
// access by identifier
let time_zone = tzdb_data::time_zone::europe::KYIV;
// access by name
let time_zone = tzdb_data::find_tz(b"Europe/Berlin").unwrap();
// names are case insensitive
let time_zone = tzdb_data::find_tz(b"ArCtIc/LoNgYeArByEn").unwrap();
```
24 changes: 22 additions & 2 deletions tzdb_data/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,35 @@
#![allow(clippy::type_complexity)]
#![no_std]

//! # tzdb_data — Time Zone Database
//!
//! [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/Kijewski/tzdb/ci.yml?branch=v0.6.x)](https://github.com/Kijewski/tzdb/actions/workflows/ci.yml)
//! [![Crates.io](https://img.shields.io/crates/v/tzdb?logo=rust)](https://crates.io/crates/tzdb)
//! ![Minimum supported Rust version](https://img.shields.io/badge/rustc-1.56+-important?logo=rust "Minimum Supported Rust Version: 1.56")
//! [![License: MIT-0](https://img.shields.io/badge/license-MIT--0-informational?logo=apache)](/LICENSE.md "License: MIT-0")
//!
//! Static, `#![no_std]` time zone information for tz-rs
//!
//! This crate provides all time zones found in the [Time Zone Database](https://www.iana.org/time-zones).
//!
//! ## Usage examples
//!
//! ```rust
//! // access by identifier
//! let time_zone = tzdb_data::time_zone::europe::KYIV;
//! // access by name
//! let time_zone = tzdb_data::find_tz(b"Europe/Berlin").unwrap();
//! // names are case insensitive
//! let time_zone = tzdb_data::find_tz(b"ArCtIc/LoNgYeArByEn").unwrap();
//! ```
//!

mod generated;

#[cfg_attr(docsrs, doc(inline))]
pub use crate::generated::{time_zone, TZ_NAMES, VERSION, VERSION_HASH};

/// Find a time zone by name, e.g. `"Europe/Berlin"` (case-insensitive)
/// Find a time zone by name, e.g. `b"Europe/Berlin"` (case-insensitive)
///
/// # Example
///
Expand All @@ -51,7 +71,7 @@ pub const fn find_tz(s: &[u8]) -> Option<&'static tz::TimeZoneRef<'static>> {
}
}

/// Find the raw, unparsed time zone data by name, e.g. `"Europe/Berlin"` (case-insensitive)
/// Find the raw, unparsed time zone data by name, e.g. `b"Europe/Berlin"` (case-insensitive)
///
/// # Example
///
Expand Down

0 comments on commit 1dc2516

Please sign in to comment.