8000 Migrate to Rust 2018 edition · unicode-rs/unicode-normalization@744c255 · GitHub
[go: up one dir, main page]

Skip to content

Commit 744c255

Browse files
committed
Migrate to Rust 2018 edition
1 parent 377b412 commit 744c255

File tree

9 files changed

+27
-25
lines changed

9 files changed

+27
-25
lines changed

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Decomposition and Recomposition, as described in
1818
Unicode Standard Annex #15.
1919
"""
2020

21+
edition = "2018"
22+
2123
exclude = [ "target/*", "Cargo.lock", "scripts/tmp", "*.txt", "tests/*" ]
2224

2325
[dependencies.tinyvec]

src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343

4444
extern crate tinyvec;
4545

46-
pub use tables::UNICODE_VERSION;
47-
pub use decompose::Decompositions;
48-
pub use quick_check::{
46+
pub use crate::tables::UNICODE_VERSION;
47+
pub use crate::decompose::Decompositions;
48+
pub use crate::quick_check::{
4949
IsNormalized,
5050
is_nfc,
5151
is_nfc_quick,
@@ -60,8 +60,8 @@ pub use quick_check::{
6060
is_nfd_stream_safe,
6161
is_nfd_stream_safe_quick,
6262
};
63-
pub use recompose::Recompositions;
64-
pub use stream_safe::StreamSafe;
63+
pub use crate::recompose::Recompositions;
64+
pub use crate::stream_safe::StreamSafe;
6565
use std::str::Chars;
6666

6767
mod decompose;
@@ -80,9 +80,9 @@ pub mod __test_api;
8080

8181
/// Methods for composing and decomposing characters.
8282
pub mod char {
83-
pub use normalize::{decompose_canonical, decompose_compatible, compose};
83+
pub use crate::normalize::{decompose_canonical, decompose_compatible, compose};
8484

85-
pub use lookups::{canonical_combining_class, is_combining_mark};
85+
pub use crate::lookups::{canonical_combining_class, is_combining_mark};
8686
}
8787

8888

src/lookups.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
//! Lookups of unicode properties using minimal perfect hashing.
1212
13-
use perfect_hash::mph_lookup;
14-
use tables::*;
13+
use crate::perfect_hash::mph_lookup;
14+
use crate::tables::*;
1515

1616
/// Look up the canonical combining class for a codepoint.
1717
///

src/normalize.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//! Functions for computing canonical and compatible decompositions for Unicode characters.
1212
use std::char;
1313
use std::ops::FnMut;
14-
use lookups::{canonical_fully_decomposed, composition_table, compatibility_fully_decomposed};
14+
use crate::lookups::{canonical_fully_decomposed, composition_table, compatibility_fully_decomposed};
1515

1616
/// Compute canonical Unicode decomposition for character.
1717
/// See [Unicode Standard Annex #15](http://www.unicode.org/reports/tr15/)
@@ -74,8 +74,8 @@ const T_BASE: u32 = 0x11A7;
7474
const L_COUNT: u32 = 19;
7575
const V_COUNT: u32 = 21;
7676
const T_COUNT: u32 = 28;
77-
const N_COUNT: u32 = (V_COUNT * T_COUNT);
78-
const S_COUNT: u32 = (L_COUNT * N_COUNT);
77+
const N_COUNT: u32 = V_COUNT * T_COUNT;
78+
const S_COUNT: u32 = L_COUNT * N_COUNT;
7979

8080
const S_LAST: u32 = S_BASE + S_COUNT - 1;
8181
const L_LAST: u32 = L_BASE + L_COUNT - 1;

src/quick_check.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
use UnicodeNormalization;
2-
use lookups::canonical_combining_class;
3-
use stream_safe;
4-
use tables;
1+
use crate::UnicodeNormalization;
2+
use crate::lookups::canonical_combining_class;
3+
use crate::stream_safe;
4+
use crate::tables;
55

66
/// The QuickCheck algorithm can quickly determine if a text is or isn't
77
/// normalized without any allocations in many cases, but it has to be able to

src/recompose.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use decompose::Decompositions;
11+
use crate::decompose::Decompositions;
1212
use tinyvec::TinyVec;
1313
use std::fmt::{self, Write};
1414

src/stream_safe.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
use normalize::{
1+
use crate::normalize::{
22
hangul_decomposition_length,
33
is_hangul_syllable,
44
};
5-
use lookups::{
5+
use crate::lookups::{
66
canonical_combining_class, canonical_fully_decomposed, compatibility_fully_decomposed,
77
stream_safe_trailing_nonstarters,
88
};
9-
use tables::stream_safe_leading_nonstarters;
9+
use crate::tables::stream_safe_leading_nonstarters;
1010

1111
pub(crate) const MAX_NONSTARTERS: usize = 30;
1212
const COMBINING_GRAPHEME_JOINER: char = '\u{034F}';
@@ -111,8 +111,8 @@ mod tests {
111111
classify_nonstarters,
112112
};
113113
use std::char;
114-
use normalize::decompose_compatible;
115-
use lookups::canonical_combining_class;
114+
use crate::normalize::decompose_compatible;
115+
use crate::lookups::canonical_combining_class;
116116

117117
fn stream_safe(s: &str) -> String {
118118
StreamSafe::new(s.chars()).collect()

src/tables.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
// NOTE: The following code was generated by "scripts/unicode.py", do not edit directly
1212

1313
#![allow(missing_docs)]
14-
use quick_check::IsNormalized;
15-
use quick_check::IsNormalized::*;
14+
use crate::quick_check::IsNormalized;
15+
use crate::quick_check::IsNormalized::*;
1616

1717
#[allow(unused)]
1818
pub const UNICODE_VERSION: (u64, u64, u64) = (9, 0, 0);

tests/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use unicode_normalization::__test_api::{
77
mod data {
88
pub mod normalization_tests;
99
}
10-
use data::normalization_tests::NORMALIZATION_TESTS;
10+
use crate::data::normalization_tests::NORMALIZATION_TESTS;
1111

1212
#[test]
1313
fn test_normalization_tests_unaffected() {

0 commit comments

Comments
 (0)
0