Skip to content

Commit

Permalink
Update publish script and docs for ucd::age
Browse files Browse the repository at this point in the history
  • Loading branch information
behnam committed Jun 22, 2017
1 parent ade9bc8 commit 2ac8a44
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 2 deletions.
1 change: 1 addition & 0 deletions .cargo/publish-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ set -e
COMPONENTS="
ucd/core/
ucd/utils/
ucd/age/
ucd/bidi/
ucd/normal/
ucd/
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,19 @@ extern crate unic;

use unic::bidi::BidiInfo;
use unic::normal::StrNormalForm;
use unic::ucd::age::{Age, CharAge};
use unic::ucd::bidi::{BidiClass, BidiChar, BidiStr};
use unic::ucd::normal::compose;

fn main() {

// Age

assert_eq!(Age::of('A'), Age::V1_1);
assert_eq!(Age::of('\u{A0000}'), Age::Unassigned);
assert_eq!(Age::of('\u{10FFFF}'), Age::V2_0);
assert_eq!('🦊'.age(), Age::V9_0);

// Bidi

let text = concat![
Expand Down
2 changes: 1 addition & 1 deletion components/ucd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Here's a list of components (available or planned) for this super-crate:
- [X] `utils`: Providing basic utilities for working with Unicode characters.


- [ ] `age`: Character Age.
- [X] `age`: Character Age.
- [ ] `name`: Character Name.
- [ ] `category`: Character General Category.

Expand Down
24 changes: 23 additions & 1 deletion examples/basics.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,34 @@
// Copyright 2015 The Servo Project Developers.
// Copyright 2017 The UNIC Project Developers.
//
// See the COPYRIGHT file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![forbid(unsafe_code)]

extern crate unic;


use unic::bidi::BidiInfo;
use unic::normal::StrNormalForm;
use unic::ucd::age::{Age, CharAge};
use unic::ucd::bidi::{BidiClass, BidiChar, BidiStr};
use unic::ucd::normal::compose;

fn main() {

// Age

assert_eq!(Age::of('A'), Age::V1_1);
assert_eq!(Age::of('\u{A0000}'), Age::Unassigned);
assert_eq!(Age::of('\u{10FFFF}'), Age::V2_0);
assert_eq!('🦊'.age(), Age::V9_0);

// Bidi

let text = concat![
Expand Down Expand Up @@ -55,7 +77,7 @@ fn main() {

// Normalization

assert_eq!(compose('A', '\u{30a}'), Some('Å'));
assert_eq!(compose('A', '\u{030A}'), Some('Å'));

let s = "ÅΩ";
let c = s.nfc().collect::<String>();
Expand Down
10 changes: 10 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,22 @@
//! ```rust
//! extern crate unic;
//!
//!
//! use unic::bidi::BidiInfo;
//! use unic::normal::StrNormalForm;
//! use unic::ucd::age::{Age, CharAge};
//! use unic::ucd::bidi::{BidiClass, BidiChar, BidiStr};
//! use unic::ucd::normal::compose;
//!
//! fn main() {
//!
//! // Age
//!
//! assert_eq!(Age::of('A'), Age::V1_1);
//! assert_eq!(Age::of('\u{A0000}'), Age::Unassigned);
//! assert_eq!(Age::of('\u{10FFFF}'), Age::V2_0);
//! assert_eq!('🦊'.age(), Age::V9_0);
//!
//! // Bidi
//!
//! let text = concat![
Expand Down

0 comments on commit 2ac8a44

Please sign in to comment.