#japanese #prefecture

jp-prefecture

an utility crate of using Japanese prefectures

7 releases (stable)

Uses new Rust 2021

1.0.4 Jun 9, 2022
1.0.3 Apr 9, 2022
1.0.2 Apr 7, 2022
0.1.1 Apr 7, 2022
0.1.0 Apr 7, 2022

#35 in Internationalization (i18n)

Download history 104/week @ 2022-04-02 76/week @ 2022-04-09 11/week @ 2022-04-16 17/week @ 2022-04-23 30/week @ 2022-04-30 35/week @ 2022-05-07 103/week @ 2022-05-14 20/week @ 2022-05-21 30/week @ 2022-05-28 61/week @ 2022-06-04 4/week @ 2022-06-11 25/week @ 2022-06-18

120 downloads per month

MIT license

66KB
1K SLoC

Crates.io Docs.rs Crates.io Test

jp-prefecture

jp-prefecture is an useful crate for using Japanese prefectures

Getting Started

Crate has to be added as dependency to Cargo.toml

[dependencies]
jp-prefecture = "1.0.4"

and imported to the scope of a block where it's begin called

use jp_prefecture::prefectures;

Examples

use jp_prefecture::prefectures;

let tokyo = prefectures::find_by_kanji("東京都");
println!("{:?}", tokyo); // => Some(Prefecture::Tokyo)
println!("{:?}", tokyo.unwrap().kanji()); // => "東京都"
println!("{:?}", tokyo.unwrap().kanji_short()); // => "東京"
println!("{:?}", tokyo.unwrap().english()); // => "tokyo"

let tokyo = prefectures::find_by_kanji("東京県"); // uhmmmm...
println!("{:?}", tokyo); // => None

Dependencies

~285–720KB
~17K SLoC