use-region 0.1.0

Small region subtag primitives for RustUse
Documentation
  • Coverage
  • 100%
    9 out of 9 items documented1 out of 9 items with examples
  • Size
  • Source code size: 5.83 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 357.95 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 4s Average build duration of successful builds.
  • all releases: 4s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-locale
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-region

Small region subtag primitives for RustUse.

Example

use use_region::{is_region_code, parse_region_code};

let region = parse_region_code("us").unwrap();

assert_eq!(region.as_str(), "US");
assert!(is_region_code("419"));

Scope

  • Validate 2-letter region subtags.
  • Validate 3-digit UN M.49-style region subtags.
  • Normalize alphabetic region subtags to uppercase.

Non-goals

  • Geocoding.
  • Geopolitical opinions.
  • Address formatting.
  • Maps.
  • Subdivision data.

License

Licensed under either of the following, at your option:

  • Apache License, Version 2.0
  • MIT license