Skip to content
/ GB2260.rs Public

The Rust implementation for looking up Chinese administrative divisions.

License

Notifications You must be signed in to change notification settings

cn/GB2260.rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GB2260.rs

Build Status Crates.io codecov docs.rs

The Rust implementation for looking up Chinese administrative divisions.

Installation

Add it to your Cargo.toml:

[dependencies]
gb2260 = "0.1"

Add extern crate gb2260 to your crate root and your're good to go!

Example

extern crate gb2260;

use gb2260::Division;

fn main() {
    let division = Division::get("110000").unwrap();
    assert_eq!(division.code, "110000");
    assert_eq!(division.name, "北京市");
    assert!(division.is_province());
    assert!(!division.is_prefecture());
    assert!(!division.is_county());
}

License

This work is released under the MIT license. A copy of the license is provided in the LICENSE file.

About

The Rust implementation for looking up Chinese administrative divisions.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages