countries-tools 0.2.0

ISO 3166 country codes and names optimized, no-std, no-alloc and without unsafe
Documentation
  • Coverage
  • 0.4%
    2 out of 506 items documented2 out of 6 items with examples
  • Size
  • Source code size: 53.51 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 4.73 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 27s Average build duration of successful builds.
  • all releases: 27s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • jhg/countries-tools-rs
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • jhg

Countries list from ISO 3166-1

Countries list from ISO 3166-1

Usage

After cargo install countries-tools:

Examples

use countries_tools::{Country, CountryAlpha2};

assert_eq!(Country::from(CountryAlpha2::ES).short_name(), "Spain");
use countries_tools::{Country, CountryAlpha3};

assert_eq!(Country::from(CountryAlpha3::USA).short_name(), "United States of America");
use countries_tools::Country;

assert_eq!(Country::try_from(392).unwrap().short_name(), "Japan");

About this crate

As much methods as possible are const fn to allow compile-time computation and optimize runtime performance.

Also this crate is no_std compatible. The crate size is kept as small as possible and also the impact on the binary size.