Skip to content

Commit 50be8d0

Browse files
committedFeb 5, 2018
[char] Add PKG_* consts
1 parent f6b6d6f commit 50be8d0

File tree

7 files changed

+74
-21
lines changed

7 files changed

+74
-21
lines changed
 

‎unic/char/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# UNIC — Unicode Characters
1+
# UNIC — Unicode Character Tools
22

33
[![Crates.io](https://img.shields.io/crates/v/unic-char.svg)](https://crates.io/crates/unic-char)
44
[![Documentation](https://docs.rs/unic-char/badge.svg)](https://docs.rs/unic-char/)

‎unic/char/property/src/lib.rs

+4-10
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#![no_std]
1212
#![forbid(unsafe_code, unconditional_recursion, missing_docs)]
1313

14-
//! # UNIC - Unicode Characters - Character Property
14+
//! # UNIC Unicode Character Tools - Character Property
1515
//!
1616
//! A component of [`unic`: Unicode and Internationalization Crates for Rust](/unic/).
1717
//!
@@ -28,19 +28,11 @@
2828
#[macro_use]
2929
extern crate unic_char_range;
3030

31-
/// UNIC component version.
32-
pub const PKG_VERSION: &str = env!("CARGO_PKG_VERSION");
33-
34-
/// UNIC component name.
35-
pub const PKG_NAME: &str = env!("CARGO_PKG_NAME");
36-
37-
/// UNIC component description.
38-
pub const PKG_DESCRIPTION: &str = env!("CARGO_PKG_DESCRIPTION");
39-
4031
// pub because is used in macros, called from macro call-site.
4132
pub mod tables;
4233

4334
mod macros;
35+
mod pkg_info;
4436
mod property;
4537
mod range_types;
4638

@@ -56,3 +48,5 @@ pub use self::range_types::{
5648
// Used in macros
5749
#[doc(hidden)]
5850
pub use core::{fmt as __fmt, str as __str};
51+
52+
pub use pkg_info::{PKG_DESCRIPTION, PKG_NAME, PKG_VERSION};

‎unic/char/property/src/pkg_info.rs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright 2017 The UNIC Project Developers.
2+
//
3+
// See the COPYRIGHT file at the top-level directory of this distribution.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
//! Package information
12+
13+
/// UNIC component version.
14+
pub const PKG_VERSION: &str = env!("CARGO_PKG_VERSION");
15+
16+
/// UNIC component name.
17+
pub const PKG_NAME: &str = env!("CARGO_PKG_NAME");
18+
19+
/// UNIC component description.
20+
pub const PKG_DESCRIPTION: &str = env!("CARGO_PKG_DESCRIPTION");

‎unic/char/range/src/lib.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#![forbid(bad_style, missing_debug_implementations, unconditional_recursion)]
1616
#![deny(missing_docs, unsafe_code, unused, future_incompatible)]
1717

18-
//! # Unic - Char - Range
18+
//! # UNIC — Unicode Character Tools - Character Range
1919
//!
2020
//! A simple way to control iteration over a range of characters.
2121
//!
@@ -52,9 +52,10 @@
5252
#[cfg(feature = "std")]
5353
extern crate core;
5454

55+
mod iter;
5556
mod macros;
57+
mod pkg_info;
5658
mod range;
57-
mod iter;
5859
mod step;
5960

6061
#[cfg(feature = "fused")]
@@ -65,3 +66,5 @@ mod iter_trusted_len;
6566

6667
pub use range::CharRange;
6768
pub use iter::CharIter;
69+
70+
pub use pkg_info::{PKG_DESCRIPTION, PKG_NAME, PKG_VERSION};

‎unic/char/range/src/pkg_info.rs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright 2017 The UNIC Project Developers.
2+
//
3+
// See the COPYRIGHT file at the top-level directory of this distribution.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
//! Package information
12+
13+
/// UNIC component version.
14+
pub const PKG_VERSION: &str = env!("CARGO_PKG_VERSION");
15+
16+
/// UNIC component name.
17+
pub const PKG_NAME: &str = env!("CARGO_PKG_NAME");
18+
19+
/// UNIC component description.
20+
pub const PKG_DESCRIPTION: &str = env!("CARGO_PKG_DESCRIPTION");

‎unic/char/src/lib.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,16 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! # UNIC — Utilities
11+
//! # UNIC — Unicode Character Tools
1212
//!
1313
//! A component of [`unic`: Unicode and Internationalization Crates for Rust](/unic/).
1414
1515
#![forbid(missing_docs)]
1616
#![deny(unsafe_code)]
1717

1818
pub extern crate unic_char_property as property;
19+
pub extern crate unic_char_range as range;
1920

20-
/// UNIC component version.
21-
pub const PKG_VERSION: &str = env!("CARGO_PKG_VERSION");
21+
mod pkg_info;
2222

23-
/// UNIC component name.
24-
pub const PKG_NAME: &str = env!("CARGO_PKG_NAME");
25-
26-
/// UNIC component description.
27-
pub const PKG_DESCRIPTION: &str = env!("CARGO_PKG_DESCRIPTION");
23+
pub use pkg_info::{PKG_DESCRIPTION, PKG_NAME, PKG_VERSION};

‎unic/char/src/pkg_info.rs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright 2017 The UNIC Project Developers.
2+
//
3+
// See the COPYRIGHT file at the top-level directory of this distribution.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
//! Package information
12+
13+
/// UNIC component version.
14+
pub const PKG_VERSION: &str = env!("CARGO_PKG_VERSION");
15+
16+
/// UNIC component name.
17+
pub const PKG_NAME: &str = env!("CARGO_PKG_NAME");
18+
19+
/// UNIC component description.
20+
pub const PKG_DESCRIPTION: &str = env!("CARGO_PKG_DESCRIPTION");

0 commit comments

Comments
 (0)
Please sign in to comment.