Skip to content

Commit ff16df1

Browse files
committed
Add some missing docs and bump version to 0.1.2
1 parent c0f1c4c commit ff16df1

File tree

19 files changed

+104
-34
lines changed

19 files changed

+104
-34
lines changed

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "unic"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
authors = ["The UNIC Project Developers"]
55
homepage = "https://github.com/behnam/rust-unic/"
66
repository = "https://github.com/behnam/rust-unic/"
@@ -13,10 +13,10 @@ readme = "README.md"
1313
[workspace]
1414

1515
[dependencies]
16-
unic-ucd = { path = "components/ucd/", version = "0.1.1" }
16+
unic-ucd = { path = "components/ucd/", version = "0.1.2" }
1717
unic-bidi = { path = "components/bidi/", version = "0.1.0" }
18-
unic-idna = { path = "components/idna/", version = "0.1.1" }
19-
unic-normal = { path = "components/normal/", version = "0.1.0" }
18+
unic-idna = { path = "components/idna/", version = "0.1.0" }
19+
unic-normal = { path = "components/normal/", version = "0.1.2" }
2020

2121
[features]
2222
default = []

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ https://github.com/behnam/rust-unic
55
[![Travis](https://img.shields.io/travis/behnam/rust-unic.svg)](https://travis-ci.org/behnam/rust-unic/)
66
[![Crates.io](https://img.shields.io/crates/v/unic.svg)](https://crates.io/crates/unic)
77
[![Documentation](https://docs.rs/unic/badge.svg)](https://docs.rs/unic/)
8+
[![Unicode-9.0.0](https://img.shields.io/badge/unicode-9.0.0-red.svg)](http://www.unicode.org/versions/Unicode9.0.0/)
89

910
**UNIC** is a project to develop components for the Rust programming language
1011
to provide high-quality and easy-to-use crates for Unicode

components/bidi/src/level.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ use unic_ucd_bidi::BidiClass;
3333
#[cfg_attr(feature = "with_serde", derive(Serialize, Deserialize))]
3434
pub struct Level(u8);
3535

36+
/// LTR level with smallest number value (0).
3637
pub const LTR_LEVEL: Level = Level(0);
38+
39+
/// RTL level with smallest number value (0).
3740
pub const RTL_LEVEL: Level = Level(1);
3841

3942
const MAX_DEPTH: u8 = 125;
@@ -191,6 +194,7 @@ impl Level {
191194
}
192195
}
193196

197+
/// Create a `Vec<Level>` from a slice of `u8` numbers
194198
pub fn vec(v: &[u8]) -> Vec<Level> {
195199
v.iter().map(|&x| x.into()).collect()
196200
}

components/bidi/src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@
1010
// except according to those terms.
1111

1212

13-
#![forbid(unsafe_code)]
14-
13+
#![forbid(unsafe_code, missing_docs)]
1514

1615
//! # UNIC — Unicode Bidirectional Algorithm
1716
//!
18-
//! This UNIC component implements algorithms from [Unicode® Standard Annex #9 - Unicode
17+
//! A component of [`unic`: Unicode and Internationalization Crates for Rust](/unic/).
18+
//!
19+
//! This UNIC component implements algorithms from [Unicode Standard Annex #9 - Unicode
1920
//! Bidirectional Algorithm](http://unicode.org/reports/tr9/), a.k.a. *UBA*, used for display of
2021
//! mixed right-to-left and left-to-right text. It is written in safe Rust, compatible with the
2122
//! current stable release.

components/idna/punycode/src/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
99
// option. This file may not be copied, modified, or distributed
1010
// except according to those terms.
1111

12+
13+
#![deny(unsafe_code)]
14+
#![forbid(missing_docs)]
15+
16+
//! # UNIC — IDNA — Punycode (RFC 3492)
17+
//!
18+
//! A component of [`unic`: Unicode and Internationalization Crates for Rust](/unic/).
19+
//!
1220
//! Implementation of Punycode ([RFC 3492](http://tools.ietf.org/html/rfc3492)) algorithm.
1321
//!
1422
//! Since Punycode fundamentally works on Unicode Code-Points,
@@ -150,6 +158,7 @@ pub fn encode_str(input: &str) -> Option<String> {
150158
///
151159
/// Return None on overflow, which can only happen on inputs that would take more than
152160
/// 63 encoded bytes, the DNS limit on domain name labels.
161+
#[allow(unsafe_code)]
153162
pub fn encode(input: &[char]) -> Option<String> {
154163
// Handle "basic" (ASCII) code points. They are encoded as-is.
155164
let output_bytes = input

components/idna/src/lib.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,15 @@
99
// option. This file may not be copied, modified, or distributed
1010
// except according to those terms.
1111

12+
13+
#![forbid(unsafe_code)]
14+
#![deny(missing_docs)]
15+
1216
//! # UNIC — Unicode IDNA Compatibility Processing
1317
//!
14-
//! This UNIC component implements algorithms from [Unicode® Technical Standard #46 - Unicode IDNA
18+
//! A component of [`unic`: Unicode and Internationalization Crates for Rust](/unic/).
19+
//!
20+
//! This UNIC component implements algorithms from [Unicode Technical Standard #46 - Unicode IDNA
1521
//! Compatibility Processing](http://unicode.org/reports/tr46/).
1622
//!
1723
//! Quoting from [UTS #46’s introduction](http://www.unicode.org/reports/tr46/#Introduction):
@@ -67,8 +73,10 @@ pub const PKG_NAME: &'static str = env!("CARGO_PKG_NAME");
6773
pub const PKG_DESCRIPTION: &'static str = env!("CARGO_PKG_DESCRIPTION");
6874

6975

76+
/// Prefix used in Punycode encoding.
7077
pub static PUNYCODE_PREFIX: &'static str = "xn--";
7178

79+
7280
fn map_char(codepoint: char, flags: Flags, output: &mut String, errors: &mut Vec<Error>) {
7381
match *find_char(codepoint) {
7482
Mapping::Valid => output.push(codepoint),
@@ -360,13 +368,16 @@ fn processing(domain: &str, flags: Flags, errors: &mut Vec<Error>) -> String {
360368
validated
361369
}
362370

371+
/// Optional settings for processing and conversion algorithms.
363372
#[derive(Copy, Clone)]
373+
#[allow(missing_docs)]
364374
pub struct Flags {
365375
pub use_std3_ascii_rules: bool,
366376
pub transitional_processing: bool,
367377
pub verify_dns_length: bool,
368378
}
369379

380+
/// Error types recorded during UTS #46 processing.
370381
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
371382
enum Error {
372383
PunycodeError,

components/normal/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "unic-normal"
3-
version = "0.1.0"
3+
version = "0.1.2"
44
authors = ["The UNIC Project Developers"]
55
homepage = "https://github.com/behnam/rust-unic/"
66
repository = "https://github.com/behnam/rust-unic/"
@@ -11,4 +11,4 @@ categories = ["parsing", "rendering", "encoding", "development-tools"]
1111
readme = "README.md"
1212

1313
[dependencies]
14-
unic-ucd-normal = { path = "../ucd/normal/", version = "0.1" }
14+
unic-ucd-normal = { path = "../ucd/normal/", version = "0.1.2" }

components/normal/src/lib.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
1-
// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
2-
// file at the top-level directory of this distribution and at
3-
// http://rust-lang.org/COPYRIGHT.
1+
// Copyright 2012-2015 The Rust Project Developers.
2+
// Copyright 2017 The UNIC Project Developers.
3+
//
4+
// See the COPYRIGHT file at the top-level directory of this distribution.
45
//
56
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
67
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
78
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
89
// option. This file may not be copied, modified, or distributed
910
// except according to those terms.
1011

12+
1113
#![forbid(unsafe_code, missing_docs)]
1214

1315
//! # UNIC — Unicode Normalization Forms
1416
//!
15-
//! This UNIC component implements algorithms from [Unicode® Standard Annex #15 - Unicode
17+
//! A component of [`unic`: Unicode and Internationalization Crates for Rust](/unic/).
18+
//!
19+
//! This UNIC component implements algorithms from [Unicode Standard Annex #15 - Unicode
1620
//! Normalization Forms](http://unicode.org/reports/tr15/).
1721
//!
1822
//! ```rust

components/ucd/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "unic-ucd"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
authors = ["The UNIC Project Developers"]
55
homepage = "https://github.com/behnam/rust-unic/"
66
repository = "https://github.com/behnam/rust-unic/"
@@ -12,5 +12,5 @@ readme = "README.md"
1212
[dependencies]
1313
unic-ucd-core = { path = "core/", version = "0.1.1" }
1414
unic-ucd-bidi = { path = "bidi/", version = "0.1.1" }
15-
unic-ucd-normal = { path = "normal/", version = "0.1.1" }
15+
unic-ucd-normal = { path = "normal/", version = "0.1.2" }
1616
unic-ucd-utils = { path = "utils/", version = "0.1.1" }

components/ucd/bidi/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111

1212

1313
#![forbid(unsafe_code)]
14+
#![deny(missing_docs)]
1415

16+
//! # UNIC — UCD — Bidi
17+
//!
18+
//! A component of [`unic`: Unicode and Internationalization Crates for Rust](/unic/).
19+
//!
1520
//! Accessor for `Bidi_Class` property from Unicode Character Database (UCD)
1621
1722

0 commit comments

Comments
 (0)