Skip to content

Commit 2ac8a44

Browse files
committed
Update publish script and docs for ucd::age
1 parent ade9bc8 commit 2ac8a44

File tree

5 files changed

+43
-2
lines changed

5 files changed

+43
-2
lines changed

.cargo/publish-all.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ set -e
2424
COMPONENTS="
2525
ucd/core/
2626
ucd/utils/
27+
ucd/age/
2728
ucd/bidi/
2829
ucd/normal/
2930
ucd/

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,19 @@ extern crate unic;
150150

151151
use unic::bidi::BidiInfo;
152152
use unic::normal::StrNormalForm;
153+
use unic::ucd::age::{Age, CharAge};
153154
use unic::ucd::bidi::{BidiClass, BidiChar, BidiStr};
154155
use unic::ucd::normal::compose;
155156

156157
fn main() {
157158

159+
// Age
160+
161+
assert_eq!(Age::of('A'), Age::V1_1);
162+
assert_eq!(Age::of('\u{A0000}'), Age::Unassigned);
163+
assert_eq!(Age::of('\u{10FFFF}'), Age::V2_0);
164+
assert_eq!('🦊'.age(), Age::V9_0);
165+
158166
// Bidi
159167

160168
let text = concat![

components/ucd/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Here's a list of components (available or planned) for this super-crate:
1919
- [X] `utils`: Providing basic utilities for working with Unicode characters.
2020

2121

22-
- [ ] `age`: Character Age.
22+
- [X] `age`: Character Age.
2323
- [ ] `name`: Character Name.
2424
- [ ] `category`: Character General Category.
2525

examples/basics.rs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,34 @@
1+
// Copyright 2015 The Servo Project Developers.
2+
// Copyright 2017 The UNIC Project Developers.
3+
//
4+
// See the COPYRIGHT file at the top-level directory of this distribution.
5+
//
6+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
7+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
8+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
9+
// option. This file may not be copied, modified, or distributed
10+
// except according to those terms.
11+
12+
#![forbid(unsafe_code)]
13+
114
extern crate unic;
215

16+
317
use unic::bidi::BidiInfo;
418
use unic::normal::StrNormalForm;
19+
use unic::ucd::age::{Age, CharAge};
520
use unic::ucd::bidi::{BidiClass, BidiChar, BidiStr};
621
use unic::ucd::normal::compose;
722

823
fn main() {
924

25+
// Age
26+
27+
assert_eq!(Age::of('A'), Age::V1_1);
28+
assert_eq!(Age::of('\u{A0000}'), Age::Unassigned);
29+
assert_eq!(Age::of('\u{10FFFF}'), Age::V2_0);
30+
assert_eq!('🦊'.age(), Age::V9_0);
31+
1032
// Bidi
1133

1234
let text = concat![
@@ -55,7 +77,7 @@ fn main() {
5577

5678
// Normalization
5779

58-
assert_eq!(compose('A', '\u{30a}'), Some('Å'));
80+
assert_eq!(compose('A', '\u{030A}'), Some('Å'));
5981

6082
let s = "ÅΩ";
6183
let c = s.nfc().collect::<String>();

src/lib.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,22 @@
3434
//! ```rust
3535
//! extern crate unic;
3636
//!
37+
//!
3738
//! use unic::bidi::BidiInfo;
3839
//! use unic::normal::StrNormalForm;
40+
//! use unic::ucd::age::{Age, CharAge};
3941
//! use unic::ucd::bidi::{BidiClass, BidiChar, BidiStr};
4042
//! use unic::ucd::normal::compose;
4143
//!
4244
//! fn main() {
45+
//!
46+
//! // Age
47+
//!
48+
//! assert_eq!(Age::of('A'), Age::V1_1);
49+
//! assert_eq!(Age::of('\u{A0000}'), Age::Unassigned);
50+
//! assert_eq!(Age::of('\u{10FFFF}'), Age::V2_0);
51+
//! assert_eq!('🦊'.age(), Age::V9_0);
52+
//!
4353
//! // Bidi
4454
//!
4555
//! let text = concat![

0 commit comments

Comments
 (0)