diff options
Diffstat (limited to 'vendor/iana-time-zone')
21 files changed, 1569 insertions, 0 deletions
diff --git a/vendor/iana-time-zone/.cargo-checksum.json b/vendor/iana-time-zone/.cargo-checksum.json new file mode 100644 index 000000000..1ff051c20 --- /dev/null +++ b/vendor/iana-time-zone/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CHANGELOG.md":"6002d865cdaa676f19ab808b8545bb1e8993a6778e549a6ea187dd3dc743baa9","Cargo.lock":"c4aa3f484b70d79c93718b0118d0fdd175d2737a1756e5e4cb80fa17c0aaecac","Cargo.toml":"d05222cc7ad10943b33bc95d7e6e116dd9689a3e498909257c460ce5090f2038","LICENSE-APACHE":"696759d65dfe558ff7d9f031c76db19ec5c0767470fb67c4e8d990820d1e99c9","LICENSE-MIT":"da28ccc6b158fc2d8cccc74e99794b1cff1d29bd7bbeb019442fcf0c04c6cad9","README.md":"c5531c44131c4b4473a747d6eab8868d31964da70af6264650253212df5ba9f4","examples/get_timezone.rs":"c4db7b1cc71c7b3728ddd70e76c0dbd40239c6b1b8c705cb63476757d3177dec","examples/stress-test.rs":"3ad469de5a650389699c9ffe5fd78af2bdd46e7140cc05391c60d793fc6f8e98","src/ffi_utils.rs":"bfbd155b004c2fc4e793aec4604c7b353f71caf35bf67e9b34cd07349628571f","src/lib.rs":"ed60b3581f02879544d87be98764f439676a1b88da7d927c7ec4a785295ec114","src/platform.rs":"bef2c3ead64d498cefedc2555194bb492db06e3d49423bdcdec5f6c5696cf091","src/tz_android.rs":"3da37f1b87f87a0ed215734f2b373b2d187bcf49386adfe8bfff207f9a5e8fe2","src/tz_freebsd.rs":"4247af5c6dd0712705186ed54d789193c64139f707af316d4fde86aa1e2a1b13","src/tz_haiku.rs":"761afd80301683a44bf937bbf6b13c5c792af42ed7037623bbeccbab6d0aa8fc","src/tz_illumos.rs":"375ae951d1417f63e6d77c9add7f7f646f24c0054cb8407bd4b9f06907494888","src/tz_linux.rs":"7bbc921fcbc71d87c5527b45f7d44963fcef5a6f2a015b78a858cf441c9e1727","src/tz_macos.rs":"081d5e60955268a1b6949089354eb6657de1c2eb569a69f4e094b995270d540d","src/tz_netbsd.rs":"ec278bbe1cb5f648c063ec23bff6081146454b9f6aa3918b9ca50b8804d5838f","src/tz_wasm32.rs":"10aa33caa86645a16e2126fe1a86dda2b57f63caa9addcd726245fbc9657dc1b","src/tz_windows.rs":"9cafe592b28505c9d2bb9adfb2924c877f1fc2685ee2be2b1e68ed45f64553f1"},"package":"0722cd7114b7de04316e7ea5456a0bbb20e4adb46fd27a3697adb812cff0f37c"}
\ No newline at end of file diff --git a/vendor/iana-time-zone/CHANGELOG.md b/vendor/iana-time-zone/CHANGELOG.md new file mode 100644 index 000000000..81159ca28 --- /dev/null +++ b/vendor/iana-time-zone/CHANGELOG.md @@ -0,0 +1,307 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.1.56] - 2023-04-03 +### Changed +- update `windows` dependency ([#102](https://github.com/strawlab/iana-time-zone/pull/102)) + +## [0.1.55] - 2023-03-30 +### Changed +- update `windows` dependency ([#101](https://github.com/strawlab/iana-time-zone/pull/101)) + +## [0.1.54] - 2023-03-21 +### Changed +- replace `winapi` dependency with `windows` ([#97](https://github.com/strawlab/iana-time-zone/pull/97)) +- bump msrv to 1.48 ([#91](https://github.com/strawlab/iana-time-zone/pull/91)) + +## [0.1.53] - 2022-10-28 +### Fixed +- remove lint causing breakage on rust 1.45-1.51 ([#84](https://github.com/strawlab/iana-time-zone/pull/84)) + +## [0.1.52] - 2022-10-28 +### Fixed +- fix for NixOS ([#81](https://github.com/strawlab/iana-time-zone/pull/81)) + +### Changed +- allow building the haiku crate on other hosts([#75](https://github.com/strawlab/iana-time-zone/pull/75)) +- various improvements in continuous integration and source quality + ([#76](https://github.com/strawlab/iana-time-zone/pull/76)), + ([#77](https://github.com/strawlab/iana-time-zone/pull/77)), + ([#78](https://github.com/strawlab/iana-time-zone/pull/78)), + ([#81](https://github.com/strawlab/iana-time-zone/pull/81)) + +## [0.1.51] - 2022-10-08 +### Changed +- bump MSRV to 1.38 ([#70](https://github.com/strawlab/iana-time-zone/pull/70)) +- Refactor Android property key CStr construction to add tests ([#69](https://github.com/strawlab/iana-time-zone/pull/69)) +- Refactor MacOS implementation a lot ([#67](https://github.com/strawlab/iana-time-zone/pull/67)) + +### Added +- Implement for Haiku ([#66](https://github.com/strawlab/iana-time-zone/pull/66)) + +### Fixed +- Fix spelling of 'initialized' in sync::Once statics ([#63](https://github.com/strawlab/iana-time-zone/pull/63)) + +## [0.1.50] - 2022-09-23 +### Fixed +- Reduce MSRV for Android again ([#62](https://github.com/strawlab/iana-time-zone/pull/62)) + +## [0.1.49] - 2022-09-22 +### Changed +- `once_cell` dependency is not needed ([#61](https://github.com/strawlab/iana-time-zone/pull/61)) + +## [0.1.48] - 2022-09-12 +### Changed +- Downgrade requirements for WASM dependencies ([#58](https://github.com/strawlab/iana-time-zone/pull/58)) +- Reduce MSRV for Tier 1 platforms to 1.31 ([#59](https://github.com/strawlab/iana-time-zone/pull/59)) + +## [0.1.47] - 2022-08-30 +### Changed +- Update `android_system_properties` to v0.1.5 to run 9786% faster (YMMV) ([#56](https://github.com/strawlab/iana-time-zone/pull/56)) + +## [0.1.46] - 2022-08-18 +### Added +- Implement for Solaris ([#55](https://github.com/strawlab/iana-time-zone/pull/55)) + +## [0.1.45] - 2022-08-16 +### Fixed +- Fix potential use after free in MacOS / iOS ([#54](https://github.com/strawlab/iana-time-zone/pull/54), [RUSTSEC-2022-0049](https://rustsec.org/advisories/RUSTSEC-2022-0049.html)) +- Fix typos in README ([#53](https://github.com/strawlab/iana-time-zone/pull/53)) + +## [0.1.44] - 2022-08-11 +### Fixed +- "/etc/localtime" may be relative link ([#49](https://github.com/strawlab/iana-time-zone/pull/49)) + +## [0.1.43] - 2022-08-11 +### Changed +- Use `core-foundation-sys` instead of `core-foundation` ([#50](https://github.com/strawlab/iana-time-zone/pull/50)) + +## [0.1.42] - 2022-08-10 +### Fixed +- Fix implementation for Redhat based distros ([#48](https://github.com/strawlab/iana-time-zone/pull/48)) + +## [0.1.41] - 2022-08-02 +### Added +- Add `fallback` feature ([#46](https://github.com/strawlab/iana-time-zone/pull/46)) + +## [0.1.40] - 2022-07-29 +### Added +- Implement for Android ([#45](https://github.com/strawlab/iana-time-zone/pull/45)) + +## [0.1.38] - 2022-07-27 +### Added +- Implement illumos ([#44](https://github.com/strawlab/iana-time-zone/pull/44)) +### Changed +- Update examples in README + +## [0.1.37] - 2022-07-23 +### Added +- Support iOS ([#41](https://github.com/strawlab/iana-time-zone/pull/41)) +### Changed +- Implement `std::err::source()`, format `IoError` ([#42](https://github.com/strawlab/iana-time-zone/pull/42)) + +## [0.1.36] - 2022-07-21 +### Fixed +- Fail to compile for WASI ([#40](https://github.com/strawlab/iana-time-zone/pull/40)) + +## [0.1.35] - 2022-06-29 +### Added +- Implement for FreeBSD, NetBSD, OpenBSD and Dragonfly ([#39](https://github.com/strawlab/iana-time-zone/pull/39)) + +## [0.1.34] - 2022-06-29 +### Added +- Implement for wasm32 ([#38](https://github.com/strawlab/iana-time-zone/pull/38)) + +## [0.1.33] - 2022-04-15 +### Changed +- Use `winapi` crate instead of `windows` crate ([#35](https://github.com/strawlab/iana-time-zone/pull/35)) + +## [0.1.32] - 2022-04-06 +### Changed +- Update `windows` requirement from 0.34 to 0.35 ([#34](https://github.com/strawlab/iana-time-zone/pull/34)) + +## [0.1.31] - 2022-03-16 +### Changed +- Update `windows` requirement from 0.33 to 0.34 ([#33](https://github.com/strawlab/iana-time-zone/pull/33)) + +## [0.1.30] - 2022-02-28 +### Changed +- Fewer string allocations ([#32](https://github.com/strawlab/iana-time-zone/pull/32)) + +## [0.1.29] - 2022-02-25 +### Changed +- Update `windows` requirement from 0.32 to 0.33 ([#31](https://github.com/strawlab/iana-time-zone/pull/31)) + +## [0.1.28] - 2022-02-04 +### Changed +- Update `windows` requirement from 0.30 to 0.32 ([#30](https://github.com/strawlab/iana-time-zone/pull/30)) + +## [0.1.27] - 2022-01-14 +### Changed +- Update `windows` requirement from 0.29 to 0.30 ([#29](https://github.com/strawlab/iana-time-zone/pull/29)) + +## [0.1.26] - 2021-12-23 +### Changed +- Update `windows` requirement from 0.28 to 0.29 ([#28](https://github.com/strawlab/iana-time-zone/pull/28)) + +## [0.1.25] - 2021-11-18 +### Changed +- Update `windows` requirement from 0.27 to 0.28 ([#27](https://github.com/strawlab/iana-time-zone/pull/27)) + +## [0.1.24] - 2021-11-16 +### Changed +- Update `windows` requirement from 0.26 to 0.27 ([#26](https://github.com/strawlab/iana-time-zone/pull/26)) + +## [0.1.23] - 2021-11-12 +### Changed +- Update `windows` requirement from 0.25 to 0.26 ([#25](https://github.com/strawlab/iana-time-zone/pull/25)) + +## [0.1.22] - 2021-11-08 +### Changed +- Update `windows` requirement from 0.24 to 0.25 ([#24](https://github.com/strawlab/iana-time-zone/pull/24)) + +## [0.1.21] - 2021-11-02 +### Changed +- Update `windows` requirement from 0.23 to 0.24 ([#23](https://github.com/strawlab/iana-time-zone/pull/23)) + +## [0.1.20] - 2021-10-29 +### Changed +- Update `windows` requirement from 0.21 to 0.23 ([#22](https://github.com/strawlab/iana-time-zone/pull/22)) + +## [0.1.19] - 2021-09-27 +### Changed +- Update `windows` requirement from 0.19 to 0.21 ([#18](https://github.com/strawlab/iana-time-zone/pull/18), [#20](https://github.com/strawlab/iana-time-zone/pull/20)) +- Update `chrono-tz` requirement from 0.5 to 0.6 ([#19](https://github.com/strawlab/iana-time-zone/pull/19)) + +## [0.1.18] - 2021-08-23 +### Changed +- Update `windows` requirement from 0.18 to 0.19 ([#17](https://github.com/strawlab/iana-time-zone/pull/17)) + +## [0.1.16] - 2021-07-26 +### Changed +- Update `windows` requirement from 0.17 to 0.18 ([#16](https://github.com/strawlab/iana-time-zone/pull/16)) + +## [0.1.15] - 2021-07-08 +### Changed +- Update `windows` requirement from 0.14 to 0.17 ([#15](https://github.com/strawlab/iana-time-zone/pull/15)) + +## [0.1.14] - 2021-07-07 +### Changed +- Update `windows` requirement from 0.13 to 0.14 ([#14](https://github.com/strawlab/iana-time-zone/pull/14)) + +## [0.1.13] - 2021-06-28 +### Changed +- Update `windows` requirement from 0.12 to 0.13 ([#13](https://github.com/strawlab/iana-time-zone/pull/13)) + +## [0.1.12] - 2021-06-28 +### Changed +- Update `windows` requirement from 0.11 to 0.12 ([#12](https://github.com/strawlab/iana-time-zone/pull/12)) + +## [0.1.11] - 2021-06-12 +### Changed +- Update `windows` requirement from 0.10 to 0.11 ([#11](https://github.com/strawlab/iana-time-zone/pull/11)) + +## [0.1.10] - 2021-05-13 +### Changed +- Update `windows` requirement from 0.9 to 0.10 ([#10](https://github.com/strawlab/iana-time-zone/pull/10)) + +## [0.1.9] - 2021-04-28 +### Changed +- Update `windows` requirement from 0.8 to 0.9 ([#8](https://github.com/strawlab/iana-time-zone/pull/8)) + +## [0.1.8] - 2021-04-13 +### Changed +- Update `windows` requirement from 0.7 to 0.8 ([#7](https://github.com/strawlab/iana-time-zone/pull/7)) + +## [0.1.7] - 2021-03-30 +### Changed +- Update `windows` requirement from 0.6 to 0.7 ([#6](https://github.com/strawlab/iana-time-zone/pull/6)) + +## [0.1.6] - 2021-03-24 +### Changed +- Update `windows` requirement from 0.5 to 0.6 ([#5](https://github.com/strawlab/iana-time-zone/pull/5)) + +## [0.1.5] - 2021-03-20 +### Changed +- Update `windows` requirement from 0.4 to 0.5 ([#4](https://github.com/strawlab/iana-time-zone/pull/4)) + +## [0.1.4] - 2021-03-11 +### Changed +- Update `windows` requirement from 0.3 to 0.4 ([#3](https://github.com/strawlab/iana-time-zone/pull/3)) + +## [0.1.3] - 2021-02-22 +### Changed +- Use `windows` crate instead of `winrt` + +## [0.1.2] - 2020-10-09 +### Changed +- Update `core-foundation` requirement from 0.7 to 0.9 ([#1](https://github.com/strawlab/iana-time-zone/pull/1)) + +## [0.1.1] - 2020-06-27 +### Changed +- Update `core-foundation` requirement from 0.5 to 0.7 + +## [0.1.0] - 2020-06-27 +### Added +- Implement for Linux, Windows, MacOS + +[0.1.56]: https://github.com/strawlab/iana-time-zone/releases/tag/v0.1.56 +[0.1.55]: https://github.com/strawlab/iana-time-zone/releases/tag/v0.1.55 +[0.1.54]: https://github.com/strawlab/iana-time-zone/releases/tag/v0.1.54 +[0.1.53]: https://github.com/strawlab/iana-time-zone/releases/tag/v0.1.53 +[0.1.52]: https://github.com/strawlab/iana-time-zone/releases/tag/v0.1.52 +[0.1.51]: https://github.com/strawlab/iana-time-zone/releases/tag/v0.1.51 +[0.1.50]: https://github.com/strawlab/iana-time-zone/releases/tag/v0.1.50 +[0.1.49]: https://github.com/strawlab/iana-time-zone/releases/tag/v0.1.49 +[0.1.48]: https://github.com/strawlab/iana-time-zone/releases/tag/v0.1.48 +[0.1.47]: https://github.com/strawlab/iana-time-zone/releases/tag/v0.1.47 +[0.1.46]: https://github.com/strawlab/iana-time-zone/releases/tag/v0.1.46 +[0.1.45]: https://github.com/strawlab/iana-time-zone/releases/tag/v0.1.45 +[0.1.44]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.44 +[0.1.43]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.43 +[0.1.42]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.42 +[0.1.41]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.41 +[0.1.40]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.40 +[0.1.39]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.39 +[0.1.38]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.38 +[0.1.37]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.37 +[0.1.36]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.36 +[0.1.35]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.35 +[0.1.34]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.34 +[0.1.33]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.33 +[0.1.32]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.32 +[0.1.31]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.31 +[0.1.30]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.30 +[0.1.29]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.29 +[0.1.28]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.28 +[0.1.27]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.27 +[0.1.26]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.26 +[0.1.25]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.25 +[0.1.24]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.24 +[0.1.23]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.23 +[0.1.22]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.22 +[0.1.21]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.21 +[0.1.20]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.20 +[0.1.19]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.19 +[0.1.18]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.18 +[0.1.17]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.17 +[0.1.16]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.16 +[0.1.15]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.15 +[0.1.14]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.14 +[0.1.13]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.13 +[0.1.12]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.12 +[0.1.11]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.11 +[0.1.10]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.10 +[0.1.9]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.9 +[0.1.8]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.8 +[0.1.7]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.7 +[0.1.6]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.6 +[0.1.5]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.5 +[0.1.4]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.4 +[0.1.3]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.3 +[0.1.2]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.2 +[0.1.1]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.1 +[0.1.0]: https://github.com/strawlab/iana-time-zone/releases/tag/0.1.0 diff --git a/vendor/iana-time-zone/Cargo.lock b/vendor/iana-time-zone/Cargo.lock new file mode 100644 index 000000000..b5d89dc35 --- /dev/null +++ b/vendor/iana-time-zone/Cargo.lock @@ -0,0 +1,421 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "bumpalo" +version = "3.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d" + +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + +[[package]] +name = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if", + "wasm-bindgen", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + +[[package]] +name = "cxx" +version = "1.0.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a140f260e6f3f79013b8bfc65e7ce630c9ab4388c6a89c71e07226f49487b72" +dependencies = [ + "cc", + "cxxbridge-flags", + "cxxbridge-macro", + "link-cplusplus", +] + +[[package]] +name = "cxx-build" +version = "1.0.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da6383f459341ea689374bf0a42979739dc421874f112ff26f829b8040b8e613" +dependencies = [ + "cc", + "codespan-reporting", + "once_cell", + "proc-macro2", + "quote", + "scratch", + "syn", +] + +[[package]] +name = "cxxbridge-flags" +version = "1.0.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90201c1a650e95ccff1c8c0bb5a343213bdd317c6e600a93075bca2eff54ec97" + +[[package]] +name = "cxxbridge-macro" +version = "1.0.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b75aed41bb2e6367cae39e6326ef817a851db13c13e4f3263714ca3cfb8de56" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.56" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-test", + "windows", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +dependencies = [ + "cxx", + "cxx-build", +] + +[[package]] +name = "js-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "libc" +version = "0.2.132" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" + +[[package]] +name = "link-cplusplus" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" +dependencies = [ + "cc", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "once_cell" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f7254b99e31cad77da24b08ebf628882739a608578bb1bcdfc1f9c21260d7c0" + +[[package]] +name = "proc-macro2" +version = "1.0.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "scoped-tls" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" + +[[package]] +name = "scratch" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" + +[[package]] +name = "syn" +version = "1.0.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "termcolor" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "unicode-ident" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" + +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + +[[package]] +name = "wasm-bindgen" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" + +[[package]] +name = "wasm-bindgen-test" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09d2fff962180c3fadf677438054b1db62bee4aa32af26a45388af07d1287e1d" +dependencies = [ + "console_error_panic_hook", + "js-sys", + "scoped-tls", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-bindgen-test-macro", +] + +[[package]] +name = "wasm-bindgen-test-macro" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4683da3dfc016f704c9f82cf401520c4f1cb3ee440f7f52b3d6ac29506a49ca7" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "web-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" diff --git a/vendor/iana-time-zone/Cargo.toml b/vendor/iana-time-zone/Cargo.toml new file mode 100644 index 000000000..5cdc175a7 --- /dev/null +++ b/vendor/iana-time-zone/Cargo.toml @@ -0,0 +1,58 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g., crates.io) dependencies. +# +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. + +[package] +edition = "2018" +name = "iana-time-zone" +version = "0.1.56" +authors = [ + "Andrew Straw <strawman@astraw.com>", + "René Kijewski <rene.kijewski@fu-berlin.de>", + "Ryan Lopopolo <rjl@hyperbo.la>", +] +description = "get the IANA time zone for the current system" +readme = "README.md" +keywords = [ + "IANA", + "time", +] +categories = [ + "date-and-time", + "internationalization", + "os", +] +license = "MIT OR Apache-2.0" +repository = "https://github.com/strawlab/iana-time-zone" + +[features] +fallback = [] + +[target."cfg(any(target_os = \"macos\", target_os = \"ios\"))".dependencies.core-foundation-sys] +version = "0.8.3" + +[target."cfg(target_arch = \"wasm32\")".dependencies.js-sys] +version = "0.3.50" + +[target."cfg(target_arch = \"wasm32\")".dependencies.wasm-bindgen] +version = "0.2.70" + +[target."cfg(target_arch = \"wasm32\")".dev-dependencies.wasm-bindgen-test] +version = "0.3" + +[target."cfg(target_os = \"android\")".dependencies.android_system_properties] +version = "0.1.5" + +[target."cfg(target_os = \"haiku\")".dependencies.iana-time-zone-haiku] +version = "0.1.1" + +[target."cfg(target_os = \"windows\")".dependencies.windows] +version = "0.48.0" +features = ["Globalization"] diff --git a/vendor/iana-time-zone/LICENSE-APACHE b/vendor/iana-time-zone/LICENSE-APACHE new file mode 100644 index 000000000..18af3f6fe --- /dev/null +++ b/vendor/iana-time-zone/LICENSE-APACHE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright 2020 Andrew Straw + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/vendor/iana-time-zone/LICENSE-MIT b/vendor/iana-time-zone/LICENSE-MIT new file mode 100644 index 000000000..8f8dd90d8 --- /dev/null +++ b/vendor/iana-time-zone/LICENSE-MIT @@ -0,0 +1,25 @@ +Copyright (c) 2020 Andrew D. Straw + +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. diff --git a/vendor/iana-time-zone/README.md b/vendor/iana-time-zone/README.md new file mode 100644 index 000000000..f9e80e206 --- /dev/null +++ b/vendor/iana-time-zone/README.md @@ -0,0 +1,47 @@ +# iana-time-zone - get the IANA time zone for the current system + +[![Crates.io](https://img.shields.io/crates/v/iana-time-zone.svg)](https://crates.io/crates/iana-time-zone) +[![Documentation](https://docs.rs/iana-time-zone/badge.svg)](https://docs.rs/iana-time-zone/) +[![Crate License](https://img.shields.io/crates/l/iana-time-zone.svg)](https://crates.io/crates/iana-time-zone) +[![build](https://github.com/strawlab/iana-time-zone/workflows/build/badge.svg?branch=main)](https://github.com/strawlab/iana-time-zone/actions?query=branch%3Amain) + +This small utility crate gets the IANA time zone for the current system. +This is also known the [tz database](https://en.wikipedia.org/wiki/Tz_database), +tzdata, the zoneinfo database, and the Olson database. + +Example: + +```rust +// Get the current time zone as a string. +let tz_str = iana_time_zone::get_timezone()?; +println!("The current time zone is: {}", tz_str); +``` + +You can test this is working on your platform with: + +``` +cargo run --example get_timezone +``` + +## Minimum supported rust version policy + +This crate has a minimum supported rust version (MSRV) of 1.48 +for [Tier 1](https://doc.rust-lang.org/1.63.0/rustc/platform-support.html) platforms. + +Updates to the MSRV are sometimes necessary due to the MSRV of dependencies. MSRV updates will +not be indicated as a breaking change to the semver version. + +## License + +Licensed under either of + +* Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or + <http://www.apache.org/licenses/LICENSE-2.0>) +* MIT license ([LICENSE-MIT](LICENSE-MIT) or + <http://opensource.org/licenses/MIT>) + +at your option. + +Unless you explicitly state otherwise, any contribution intentionally submitted +for inclusion in the work by you, as defined in the Apache-2.0 license, shall be +dual licensed as above, without any additional terms or conditions. diff --git a/vendor/iana-time-zone/examples/get_timezone.rs b/vendor/iana-time-zone/examples/get_timezone.rs new file mode 100644 index 000000000..0f5119f56 --- /dev/null +++ b/vendor/iana-time-zone/examples/get_timezone.rs @@ -0,0 +1,6 @@ +use iana_time_zone::{get_timezone, GetTimezoneError}; + +fn main() -> Result<(), GetTimezoneError> { + println!("{}", get_timezone()?); + Ok(()) +} diff --git a/vendor/iana-time-zone/examples/stress-test.rs b/vendor/iana-time-zone/examples/stress-test.rs new file mode 100644 index 000000000..73df86f51 --- /dev/null +++ b/vendor/iana-time-zone/examples/stress-test.rs @@ -0,0 +1,25 @@ +use std::sync::atomic::{AtomicUsize, Ordering}; +use std::thread::spawn; + +use iana_time_zone::get_timezone; + +const THREADS: usize = 10; +const ITERATIONS: usize = 100_000; + +static COUNT: AtomicUsize = AtomicUsize::new(0); + +fn main() { + let mut threads = Vec::with_capacity(THREADS); + for _ in 0..THREADS { + threads.push(spawn(|| { + for _ in 0..ITERATIONS { + get_timezone().unwrap(); + COUNT.fetch_add(1, Ordering::Relaxed); + } + })); + } + for thread in threads { + thread.join().unwrap(); + } + assert_eq!(COUNT.load(Ordering::SeqCst), THREADS * ITERATIONS); +} diff --git a/vendor/iana-time-zone/src/ffi_utils.rs b/vendor/iana-time-zone/src/ffi_utils.rs new file mode 100644 index 000000000..842b850e8 --- /dev/null +++ b/vendor/iana-time-zone/src/ffi_utils.rs @@ -0,0 +1,49 @@ +//! Cross platform FFI helpers. + +use std::ffi::CStr; + +// The system property named 'persist.sys.timezone' contains the name of the +// current timezone. +// +// From https://android.googlesource.com/platform/bionic/+/gingerbread-release/libc/docs/OVERVIEW.TXT#79: +// +// > The name of the current timezone is taken from the TZ environment variable, +// > if defined. Otherwise, the system property named 'persist.sys.timezone' is +// > checked instead. +const ANDROID_TIMEZONE_PROPERTY_NAME: &[u8] = b"persist.sys.timezone\0"; + +/// Return a [`CStr`] to access the timezone from an Android system properties +/// environment. +pub(crate) fn android_timezone_property_name() -> &'static CStr { + // In tests or debug mode, opt into extra runtime checks. + if cfg!(any(test, debug_assertions)) { + return CStr::from_bytes_with_nul(ANDROID_TIMEZONE_PROPERTY_NAME).unwrap(); + } + + // SAFETY: the key is NUL-terminated and there are no other NULs, this + // invariant is checked in tests. + unsafe { CStr::from_bytes_with_nul_unchecked(ANDROID_TIMEZONE_PROPERTY_NAME) } +} + +#[cfg(test)] +mod tests { + use std::ffi::CStr; + + use super::{android_timezone_property_name, ANDROID_TIMEZONE_PROPERTY_NAME}; + + #[test] + fn test_android_timezone_property_name_is_valid_cstr() { + CStr::from_bytes_with_nul(ANDROID_TIMEZONE_PROPERTY_NAME).unwrap(); + + let mut invalid_property_name = ANDROID_TIMEZONE_PROPERTY_NAME.to_owned(); + invalid_property_name.push(b'\0'); + CStr::from_bytes_with_nul(&invalid_property_name).unwrap_err(); + } + + #[test] + fn test_android_timezone_property_name_getter() { + let key = android_timezone_property_name().to_bytes_with_nul(); + assert_eq!(key, ANDROID_TIMEZONE_PROPERTY_NAME); + std::str::from_utf8(key).unwrap(); + } +} diff --git a/vendor/iana-time-zone/src/lib.rs b/vendor/iana-time-zone/src/lib.rs new file mode 100644 index 000000000..fe4e3fb84 --- /dev/null +++ b/vendor/iana-time-zone/src/lib.rs @@ -0,0 +1,113 @@ +#![warn(clippy::all)] +#![warn(clippy::cargo)] +#![warn(clippy::undocumented_unsafe_blocks)] +#![allow(unknown_lints)] +#![warn(missing_copy_implementations)] +#![warn(missing_debug_implementations)] +#![warn(missing_docs)] +#![warn(rust_2018_idioms)] +#![warn(trivial_casts, trivial_numeric_casts)] +#![warn(unused_qualifications)] +#![warn(variant_size_differences)] + +//! get the IANA time zone for the current system +//! +//! This small utility crate provides the +//! [`get_timezone()`](fn.get_timezone.html) function. +//! +//! ```rust +//! // Get the current time zone as a string. +//! let tz_str = iana_time_zone::get_timezone()?; +//! println!("The current time zone is: {}", tz_str); +//! # Ok::<(), iana_time_zone::GetTimezoneError>(()) +//! ``` +//! +//! The resulting string can be parsed to a +//! [`chrono-tz::Tz`](https://docs.rs/chrono-tz/latest/chrono_tz/enum.Tz.html) +//! variant like this: +//! ```ignore +//! let tz_str = iana_time_zone::get_timezone()?; +//! let tz: chrono_tz::Tz = tz_str.parse()?; +//! ``` + +#[allow(dead_code)] +mod ffi_utils; + +#[cfg_attr(target_os = "linux", path = "tz_linux.rs")] +#[cfg_attr(target_os = "windows", path = "tz_windows.rs")] +#[cfg_attr(any(target_os = "macos", target_os = "ios"), path = "tz_macos.rs")] +#[cfg_attr( + all(target_arch = "wasm32", not(target_os = "wasi")), + path = "tz_wasm32.rs" +)] +#[cfg_attr( + any(target_os = "freebsd", target_os = "dragonfly"), + path = "tz_freebsd.rs" +)] +#[cfg_attr( + any(target_os = "netbsd", target_os = "openbsd"), + path = "tz_netbsd.rs" +)] +#[cfg_attr( + any(target_os = "illumos", target_os = "solaris"), + path = "tz_illumos.rs" +)] +#[cfg_attr(target_os = "android", path = "tz_android.rs")] +#[cfg_attr(target_os = "haiku", path = "tz_haiku.rs")] +mod platform; + +/// Error types +#[derive(Debug)] +pub enum GetTimezoneError { + /// Failed to parse + FailedParsingString, + /// Wrapped IO error + IoError(std::io::Error), + /// Platform-specific error from the operating system + OsError, +} + +impl std::error::Error for GetTimezoneError { + fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { + match self { + GetTimezoneError::FailedParsingString => None, + GetTimezoneError::IoError(err) => Some(err), + GetTimezoneError::OsError => None, + } + } +} + +impl std::fmt::Display for GetTimezoneError { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + f.write_str(match self { + GetTimezoneError::FailedParsingString => "GetTimezoneError::FailedParsingString", + GetTimezoneError::IoError(err) => return err.fmt(f), + GetTimezoneError::OsError => "OsError", + }) + } +} + +impl From<std::io::Error> for GetTimezoneError { + fn from(orig: std::io::Error) -> Self { + GetTimezoneError::IoError(orig) + } +} + +/// Get the current IANA time zone as a string. +/// +/// See the module-level documentation for a usage example and more details +/// about this function. +#[inline] +pub fn get_timezone() -> Result<String, GetTimezoneError> { + platform::get_timezone_inner() +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn get_current() { + println!("current: {}", get_timezone().unwrap()); + } +} diff --git a/vendor/iana-time-zone/src/platform.rs b/vendor/iana-time-zone/src/platform.rs new file mode 100644 index 000000000..5992bf377 --- /dev/null +++ b/vendor/iana-time-zone/src/platform.rs @@ -0,0 +1,9 @@ +pub fn get_timezone_inner() -> std::result::Result<String, crate::GetTimezoneError> { + Err(crate::GetTimezoneError::OsError) +} + +#[cfg(not(feature = "fallback"))] +compile_error!( + "iana-time-zone is currently implemented for Linux, Window, MacOS, FreeBSD, NetBSD, \ + OpenBSD, Dragonfly, WebAssembly (browser), iOS, Illumos, Android, Solaris and Haiku.", +); diff --git a/vendor/iana-time-zone/src/tz_android.rs b/vendor/iana-time-zone/src/tz_android.rs new file mode 100644 index 000000000..27255b52f --- /dev/null +++ b/vendor/iana-time-zone/src/tz_android.rs @@ -0,0 +1,27 @@ +use std::sync::Once; + +use android_system_properties::AndroidSystemProperties; + +use crate::ffi_utils::android_timezone_property_name; + +pub(crate) fn get_timezone_inner() -> Result<String, crate::GetTimezoneError> { + let key = android_timezone_property_name(); + + get_properties() + .and_then(|properties| properties.get_from_cstr(key)) + .ok_or(crate::GetTimezoneError::OsError) +} + +fn get_properties() -> Option<&'static AndroidSystemProperties> { + static INITIALIZED: Once = Once::new(); + static mut PROPERTIES: Option<AndroidSystemProperties> = None; + + INITIALIZED.call_once(|| { + let properties = AndroidSystemProperties::new(); + // SAFETY: `INITIALIZED` is synchronizing. The variable is only assigned to once. + unsafe { PROPERTIES = Some(properties) }; + }); + + // SAFETY: `INITIALIZED` is synchronizing. The variable is only assigned to once. + unsafe { PROPERTIES.as_ref() } +} diff --git a/vendor/iana-time-zone/src/tz_freebsd.rs b/vendor/iana-time-zone/src/tz_freebsd.rs new file mode 100644 index 000000000..4d55e1536 --- /dev/null +++ b/vendor/iana-time-zone/src/tz_freebsd.rs @@ -0,0 +1,7 @@ +pub(crate) fn get_timezone_inner() -> Result<String, crate::GetTimezoneError> { + // see https://gitlab.gnome.org/GNOME/evolution-data-server/-/issues/19 + let mut contents = std::fs::read_to_string("/var/db/zoneinfo")?; + // Trim to the correct length without allocating. + contents.truncate(contents.trim_end().len()); + Ok(contents) +} diff --git a/vendor/iana-time-zone/src/tz_haiku.rs b/vendor/iana-time-zone/src/tz_haiku.rs new file mode 100644 index 000000000..d78372b6d --- /dev/null +++ b/vendor/iana-time-zone/src/tz_haiku.rs @@ -0,0 +1,3 @@ +pub(crate) fn get_timezone_inner() -> Result<String, crate::GetTimezoneError> { + iana_time_zone_haiku::get_timezone().ok_or(crate::GetTimezoneError::OsError) +} diff --git a/vendor/iana-time-zone/src/tz_illumos.rs b/vendor/iana-time-zone/src/tz_illumos.rs new file mode 100644 index 000000000..17b099b10 --- /dev/null +++ b/vendor/iana-time-zone/src/tz_illumos.rs @@ -0,0 +1,22 @@ +use std::fs::OpenOptions; +use std::io::{BufRead, BufReader}; + +pub(crate) fn get_timezone_inner() -> Result<String, crate::GetTimezoneError> { + // https://illumos.org/man/5/TIMEZONE + // https://docs.oracle.com/cd/E23824_01/html/821-1473/uc-timezone-4.html + + let file = OpenOptions::new().read(true).open("/etc/default/init")?; + let mut reader = BufReader::with_capacity(1536, file); + let mut line = String::with_capacity(80); + loop { + line.clear(); + let count = reader.read_line(&mut line)?; + if count == 0 { + return Err(crate::GetTimezoneError::FailedParsingString); + } else if line.starts_with("TZ=") { + line.truncate(line.trim_end().len()); + line.replace_range(..3, ""); + return Ok(line); + } + } +} diff --git a/vendor/iana-time-zone/src/tz_linux.rs b/vendor/iana-time-zone/src/tz_linux.rs new file mode 100644 index 000000000..c1133e1cd --- /dev/null +++ b/vendor/iana-time-zone/src/tz_linux.rs @@ -0,0 +1,45 @@ +use std::fs::{read_link, read_to_string}; + +pub(crate) fn get_timezone_inner() -> Result<String, crate::GetTimezoneError> { + etc_localtime().or_else(|_| etc_timezone()) +} + +fn etc_timezone() -> Result<String, crate::GetTimezoneError> { + // see https://stackoverflow.com/a/12523283 + let mut contents = read_to_string("/etc/timezone")?; + // Trim to the correct length without allocating. + contents.truncate(contents.trim_end().len()); + Ok(contents) +} + +fn etc_localtime() -> Result<String, crate::GetTimezoneError> { + // Per <https://www.man7.org/linux/man-pages/man5/localtime.5.html>: + // “ The /etc/localtime file configures the system-wide timezone of the local system that is + // used by applications for presentation to the user. It should be an absolute or relative + // symbolic link pointing to /usr/share/zoneinfo/, followed by a timezone identifier such as + // "Europe/Berlin" or "Etc/UTC". The resulting link should lead to the corresponding binary + // tzfile(5) timezone data for the configured timezone. ” + + // Systemd does not canonicalize the link, but only checks if it is prefixed by + // "/usr/share/zoneinfo/" or "../usr/share/zoneinfo/". So we do the same. + // <https://github.com/systemd/systemd/blob/9102c625a673a3246d7e73d8737f3494446bad4e/src/basic/time-util.c#L1493> + + const PREFIXES: &[&str] = &[ + "/usr/share/zoneinfo/", // absolute path + "../usr/share/zoneinfo/", // relative path + "/etc/zoneinfo/", // absolute path for NixOS + "../etc/zoneinfo/", // relative path for NixOS + ]; + let mut s = read_link("/etc/localtime")? + .into_os_string() + .into_string() + .map_err(|_| crate::GetTimezoneError::FailedParsingString)?; + for &prefix in PREFIXES { + if s.starts_with(prefix) { + // Trim to the correct length without allocating. + s.replace_range(..prefix.len(), ""); + return Ok(s); + } + } + Err(crate::GetTimezoneError::FailedParsingString) +} diff --git a/vendor/iana-time-zone/src/tz_macos.rs b/vendor/iana-time-zone/src/tz_macos.rs new file mode 100644 index 000000000..70c39e83f --- /dev/null +++ b/vendor/iana-time-zone/src/tz_macos.rs @@ -0,0 +1,144 @@ +pub(crate) fn get_timezone_inner() -> Result<String, crate::GetTimezoneError> { + get_timezone().ok_or(crate::GetTimezoneError::OsError) +} + +#[inline] +fn get_timezone() -> Option<String> { + // The longest name in the IANA time zone database is 25 ASCII characters long. + const MAX_LEN: usize = 32; + let mut buf = [0; MAX_LEN]; + + // Get system time zone, and borrow its name. + let tz = system_time_zone::SystemTimeZone::new()?; + let name = tz.name()?; + + // If the name is encoded in UTF-8, copy it directly. + let name = if let Some(name) = name.as_utf8() { + name + } else { + // Otherwise convert the name to UTF-8. + name.to_utf8(&mut buf)? + }; + + if name.is_empty() || name.len() >= MAX_LEN { + // The name should not be empty, or excessively long. + None + } else { + Some(name.to_owned()) + } +} + +mod system_time_zone { + //! create a safe wrapper around `CFTimeZoneRef` + + use core_foundation_sys::base::{CFRelease, CFTypeRef}; + use core_foundation_sys::timezone::{CFTimeZoneCopySystem, CFTimeZoneGetName, CFTimeZoneRef}; + + pub(crate) struct SystemTimeZone(CFTimeZoneRef); + + impl Drop for SystemTimeZone { + fn drop(&mut self) { + // SAFETY: `SystemTimeZone` is only ever created with a valid `CFTimeZoneRef`. + unsafe { CFRelease(self.0 as CFTypeRef) }; + } + } + + impl SystemTimeZone { + pub(crate) fn new() -> Option<Self> { + // SAFETY: No invariants to uphold. We'll release the pointer when we don't need it anymore. + let v: CFTimeZoneRef = unsafe { CFTimeZoneCopySystem() }; + if v.is_null() { + None + } else { + Some(SystemTimeZone(v)) + } + } + + /// Get the time zone name as a [super::string_ref::StringRef]. + /// + /// The lifetime of the `StringRef` is bound to our lifetime. Mutable + /// access is also prevented by taking a reference to `self`. + pub(crate) fn name(&self) -> Option<super::string_ref::StringRef<'_, Self>> { + // SAFETY: `SystemTimeZone` is only ever created with a valid `CFTimeZoneRef`. + let string = unsafe { CFTimeZoneGetName(self.0) }; + if string.is_null() { + None + } else { + // SAFETY: here we ensure that `string` is a valid pointer. + Some(unsafe { super::string_ref::StringRef::new(string, self) }) + } + } + } +} + +mod string_ref { + //! create safe wrapper around `CFStringRef` + + use std::convert::TryInto; + + use core_foundation_sys::base::{Boolean, CFRange}; + use core_foundation_sys::string::{ + kCFStringEncodingUTF8, CFStringGetBytes, CFStringGetCStringPtr, CFStringGetLength, + CFStringRef, + }; + + pub(crate) struct StringRef<'a, T> { + string: CFStringRef, + // We exclude mutable access to the parent by taking a reference to the + // parent (rather than, for example, just using a marker to enforce the + // parent's lifetime). + _parent: &'a T, + } + + impl<'a, T> StringRef<'a, T> { + // SAFETY: `StringRef` must be valid pointer + pub(crate) unsafe fn new(string: CFStringRef, _parent: &'a T) -> Self { + Self { string, _parent } + } + + pub(crate) fn as_utf8(&self) -> Option<&'a str> { + // SAFETY: `StringRef` is only ever created with a valid `CFStringRef`. + let v = unsafe { CFStringGetCStringPtr(self.string, kCFStringEncodingUTF8) }; + if !v.is_null() { + // SAFETY: `CFStringGetCStringPtr()` returns NUL-terminated strings. + let v = unsafe { std::ffi::CStr::from_ptr(v) }; + if let Ok(v) = v.to_str() { + return Some(v); + } + } + None + } + + pub(crate) fn to_utf8<'b>(&self, buf: &'b mut [u8]) -> Option<&'b str> { + // SAFETY: `StringRef` is only ever created with a valid `CFStringRef`. + let length = unsafe { CFStringGetLength(self.string) }; + + let mut buf_bytes = 0; + let range = CFRange { + location: 0, + length, + }; + + let converted_bytes = unsafe { + // SAFETY: `StringRef` is only ever created with a valid `CFStringRef`. + CFStringGetBytes( + self.string, + range, + kCFStringEncodingUTF8, + b'\0', + false as Boolean, + buf.as_mut_ptr(), + buf.len() as isize, + &mut buf_bytes, + ) + }; + if converted_bytes != length { + return None; + } + + let len = buf_bytes.try_into().ok()?; + let s = buf.get(..len)?; + std::str::from_utf8(s).ok() + } + } +} diff --git a/vendor/iana-time-zone/src/tz_netbsd.rs b/vendor/iana-time-zone/src/tz_netbsd.rs new file mode 100644 index 000000000..84cf8b05e --- /dev/null +++ b/vendor/iana-time-zone/src/tz_netbsd.rs @@ -0,0 +1,25 @@ +use std::fs::read_link; + +pub(crate) fn get_timezone_inner() -> Result<String, crate::GetTimezoneError> { + // see https://www.cyberciti.biz/faq/openbsd-time-zone-howto/ + + // This is a backport of the Linux implementation. + // NetBSDs is less than thorough how the softlink should be set up. + + const PREFIXES: &[&str] = &[ + "/usr/share/zoneinfo/", // absolute path + "../usr/share/zoneinfo/", // relative path + ]; + let mut s = read_link("/etc/localtime")? + .into_os_string() + .into_string() + .map_err(|_| crate::GetTimezoneError::FailedParsingString)?; + for &prefix in PREFIXES { + if s.starts_with(prefix) { + // Trim to the correct length without allocating. + s.replace_range(..prefix.len(), ""); + return Ok(s); + } + } + Err(crate::GetTimezoneError::FailedParsingString) +} diff --git a/vendor/iana-time-zone/src/tz_wasm32.rs b/vendor/iana-time-zone/src/tz_wasm32.rs new file mode 100644 index 000000000..69c36b553 --- /dev/null +++ b/vendor/iana-time-zone/src/tz_wasm32.rs @@ -0,0 +1,21 @@ +use js_sys::{Array, Intl, Object, Reflect}; +use wasm_bindgen::JsValue; + +pub(crate) fn get_timezone_inner() -> Result<String, crate::GetTimezoneError> { + let intl = Intl::DateTimeFormat::new(&Array::new(), &Object::new()).resolved_options(); + Reflect::get(&intl, &JsValue::from_str("timeZone")) + .ok() + .and_then(|tz| tz.as_string()) + .ok_or(crate::GetTimezoneError::OsError) +} + +#[cfg(test)] +mod tests { + use wasm_bindgen_test::*; + + #[wasm_bindgen_test] + fn pass() { + let tz = super::get_timezone_inner().unwrap(); + console_log!("tz={:?}", tz); + } +} diff --git a/vendor/iana-time-zone/src/tz_windows.rs b/vendor/iana-time-zone/src/tz_windows.rs new file mode 100644 index 000000000..eaa5d5a48 --- /dev/null +++ b/vendor/iana-time-zone/src/tz_windows.rs @@ -0,0 +1,13 @@ +use windows::Globalization::Calendar; + +impl From<windows::core::Error> for crate::GetTimezoneError { + fn from(orig: windows::core::Error) -> Self { + crate::GetTimezoneError::IoError(std::io::Error::new(std::io::ErrorKind::Other, orig)) + } +} + +pub(crate) fn get_timezone_inner() -> Result<String, crate::GetTimezoneError> { + let cal = Calendar::new()?; + let tz_hstring = cal.GetTimeZone()?; + Ok(tz_hstring.to_string()) +} |