Skip to content

Commit

Permalink
TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
Kijewski committed Dec 29, 2023
1 parent acb5168 commit abed2e7
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 50 deletions.
4 changes: 0 additions & 4 deletions .gitmodules

This file was deleted.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ rust-version = "1.60"

[dependencies]
tz-rs = { version = "^0.6.14", default-features = false, features = ["const"] }
tzdb_06 = { package = "tzdb", version = "0.6.0" }

# optional dependencies
iana-time-zone = { version = "^0.1.46", default-features = false, optional = true }
Expand Down
1 change: 0 additions & 1 deletion src/generated
Submodule generated deleted from 1b3e5a
47 changes: 2 additions & 45 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ extern crate std;

#[cfg(docsrs)]
pub mod changelog;
mod generated;
#[cfg(feature = "now")]
#[cfg_attr(docsrs, doc(cfg(feature = "now")))]
pub mod now;
Expand All @@ -104,50 +103,8 @@ mod test_by_name;
#[cfg(feature = "local")]
use iana_time_zone::get_timezone;

pub use crate::generated::time_zone;

/// The version of the source Time Zone Database
pub const VERSION: &str = self::generated::VERSION;

/// The SHA512 hash of the source Time Zone Database (using the "Complete Distribution")
pub const VERSION_HASH: &str = self::generated::VERSION_HASH;

/// Find a time zone by name, e.g. `"Europe/Berlin"` (case-insensitive)
///
/// # Example
///
/// ```
/// # #[cfg(feature = "by-name")] let _: () = {
/// assert_eq!(
/// tzdb::time_zone::europe::BERLIN,
/// tzdb::tz_by_name("Europe/Berlin").unwrap(),
/// );
/// # };
/// ```
#[inline]
pub fn tz_by_name<S: AsRef<[u8]>>(s: S) -> Option<tz::TimeZoneRef<'static>> {
generated::by_name::find_tz(s.as_ref())
}

/// Find the raw, unparsed time zone data by name, e.g. `"Europe/Berlin"` (case-insensitive)
///
/// # Example
///
/// ```
/// # #[cfg(all(feature = "binary", feature = "by-name"))] let _: () = {
/// assert_eq!(
/// tzdb::time_zone::europe::RAW_BERLIN,
/// tzdb::raw_tz_by_name("Europe/Berlin").unwrap(),
/// );
/// # };
/// ```
#[inline]
pub fn raw_tz_by_name<S: AsRef<[u8]>>(s: S) -> Option<&'static [u8]> {
generated::by_name::find_raw(s.as_ref())
}

/// A list of all known time zones
pub const TZ_NAMES: &[&str] = &crate::generated::TIME_ZONES_LIST;
#[cfg_attr(docsrs, doc(no_inline))]
pub use tzdb_06::{raw_tz_by_name, time_zone, tz_by_name, TZ_NAMES, VERSION, VERSION_HASH};

/// Find the time zone of the current system
///
Expand Down

0 comments on commit abed2e7

Please sign in to comment.