Skip to content

Commit

Permalink
Merge #248
Browse files Browse the repository at this point in the history
248: Migrate to Rust 2018 Edition r=behnam a=behnam

Using automated cargo fix runs and manual fixes from its hints.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/open-i18n/rust-unic/248)
<!-- Reviewable:end -->


Co-authored-by: Behnam Esfahbod <[email protected]>
  • Loading branch information
bors[bot] and behnam committed Jan 6, 2019
2 parents bb20514 + 06277f9 commit 10ca3c8
Show file tree
Hide file tree
Showing 185 changed files with 425 additions and 526 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ rust:
- nightly
- beta
- stable
- 1.28.0 # = MIN_RUST_VERSION
- 1.31.0 # = MIN_RUST_VERSION

branches:
except:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[![Travis](https://img.shields.io/travis/open-i18n/rust-unic/master.svg?label=Linux%20build)](https://travis-ci.org/open-i18n/rust-unic/)
[![AppVeyor](https://img.shields.io/appveyor/ci/open-i18n/rust-unic/master.svg?label=Windows%20build)](https://ci.appveyor.com/project/open-i18n/rust-unic)
[![Rust-1.28.0+](https://img.shields.io/badge/rustc-1.28+-red.svg#MIN_RUST_VERSION)](https://www.rust-lang.org/)
[![Rust-1.31.0+](https://img.shields.io/badge/rustc-1.28+-red.svg#MIN_RUST_VERSION)](https://www.rust-lang.org/)
[![Unicode-10.0.0](https://img.shields.io/badge/unicode-10.0.0-red.svg)](https://www.unicode.org/versions/Unicode10.0.0/)
[![Release](https://img.shields.io/github/release/open-i18n/rust-unic.svg)](https://github.com/open-i18n/rust-unic/)
[![Crates.io](https://img.shields.io/crates/v/unic.svg)](https://crates.io/crates/unic/)
Expand Down
1 change: 1 addition & 0 deletions apps/cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "unic-cli"
version = "0.8.0"
edition = "2018"
authors = ["The UNIC Project Developers"]
repository = "https://github.com/open-i18n/rust-unic/"
license = "MIT/Apache-2.0"
Expand Down
3 changes: 0 additions & 3 deletions apps/cli/src/bin/unic-inspector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ extern crate clap;
#[macro_use]
extern crate prettytable;

extern crate unic;
extern crate unic_cli;

use clap::Arg;
use prettytable::format::TableFormat;
use prettytable::Table;
Expand Down
2 changes: 1 addition & 1 deletion apps/cli/src/bin/unic-versions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

//! Command-line tool to list versions of UNIC components.
extern crate unic;
use unic;

macro_rules! print_component_desc {
( $component:tt ) => {
Expand Down
1 change: 0 additions & 1 deletion apps/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

#[macro_use]
extern crate lazy_static;
extern crate regex;

pub mod parsers;
pub mod writers;
Expand Down
2 changes: 0 additions & 2 deletions apps/cli/tests/quickcheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
#[macro_use]
extern crate quickcheck;

extern crate unic_cli;

use unic_cli::parsers;
use unic_cli::writers;

Expand Down
2 changes: 0 additions & 2 deletions apps/cli/tests/test_unic-echo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

extern crate assert_cli;

use assert_cli::Assert;

// At the moment, there's no way to test stdout value for an exact string, therefore a mix of
Expand Down
1 change: 1 addition & 0 deletions gen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "unic-gen"
version = "0.0.0"
edition = "2018"
authors = ["The UNIC Project Developers"]
repository = "https://github.com/open-i18n/rust-unic/"
license = "MIT/Apache-2.0"
Expand Down
3 changes: 0 additions & 3 deletions gen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ extern crate lazy_static;
#[macro_use]
extern crate matches;

extern crate itertools;
extern crate regex;

mod source;
mod writer;

Expand Down
4 changes: 2 additions & 2 deletions gen/src/source/emoji/emoji_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use std::char;
use std::collections::BTreeSet;
use std::str::FromStr;

use source::ucd::BINARY_PROPERTIES_REGEX;
use source::utils::read;
use crate::source::ucd::BINARY_PROPERTIES_REGEX;
use crate::source::utils::read;

lazy_static! {
pub static ref EMOJI_DATA: EmojiData = {
Expand Down
2 changes: 1 addition & 1 deletion gen/src/source/emoji/readme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use std::str::FromStr;

use regex::Regex;

use source::utils::read;
use crate::source::utils::read;

pub struct EmojiDataVersion {
pub major: u8,
Expand Down
2 changes: 1 addition & 1 deletion gen/src/source/idna/idna_mapping_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use std::str::FromStr;

use regex::Regex;

use source::utils::read;
use crate::source::utils::read;

lazy_static! {
pub static ref IDNA_MAPPING: IdnaMapping = {
Expand Down
4 changes: 2 additions & 2 deletions gen/src/source/idna/readme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use source::common::unicode_version::UnicodeVersion;
use source::utils::read;
use crate::source::common::unicode_version::UnicodeVersion;
use crate::source::utils::read;

lazy_static! {
pub static ref UNICODE_VERSION: UnicodeVersion = {
Expand Down
2 changes: 1 addition & 1 deletion gen/src/source/ucd/blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use std::str::FromStr;

use regex::Regex;

use source::utils::read;
use crate::source::utils::read;

lazy_static! {
pub static ref BLOCKS_DATA: BlocksData = {
Expand Down
2 changes: 1 addition & 1 deletion gen/src/source/ucd/derived_age.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use std::str::FromStr;

use regex::Regex;

use source::utils::read;
use crate::source::utils::read;

lazy_static! {
pub static ref AGE_DATA: AgeData = {
Expand Down
2 changes: 1 addition & 1 deletion gen/src/source/ucd/derived_core_properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use std::char;
use std::collections::BTreeSet;
use std::str::FromStr;

use source::utils::read;
use crate::source::utils::read;

use super::BINARY_PROPERTIES_REGEX;

Expand Down
2 changes: 1 addition & 1 deletion gen/src/source/ucd/derived_normalization_props.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use std::str::FromStr;

use regex::Regex;

use source::utils::read;
use crate::source::utils::read;

lazy_static! {
pub static ref COMPOSITION_EXCLUSIONS: CompositionExclusions = {
Expand Down
2 changes: 1 addition & 1 deletion gen/src/source/ucd/grapheme_break_property.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use std::str::FromStr;

use regex::Regex;

use source::utils::read;
use crate::source::utils::read;

lazy_static! {
pub static ref GRAPHEME_CLUSTER_BREAK_DATA: GraphemeClusterBreakData = {
Expand Down
2 changes: 1 addition & 1 deletion gen/src/source/ucd/jamo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use std::str::FromStr;

use regex::Regex;

use source::utils::read;
use crate::source::utils::read;

lazy_static! {
pub static ref JAMO_DATA: JamoData =
Expand Down
2 changes: 1 addition & 1 deletion gen/src/source/ucd/prop_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use std::char;
use std::collections::BTreeSet;
use std::str::FromStr;

use source::utils::read;
use crate::source::utils::read;

use super::BINARY_PROPERTIES_REGEX;

Expand Down
4 changes: 2 additions & 2 deletions gen/src/source/ucd/readme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use source::common::unicode_version::UnicodeVersion;
use source::utils::read;
use crate::source::common::unicode_version::UnicodeVersion;
use crate::source::utils::read;

lazy_static! {
pub static ref UNICODE_VERSION: UnicodeVersion = {
Expand Down
2 changes: 1 addition & 1 deletion gen/src/source/ucd/sentence_break_property.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use std::str::FromStr;

use regex::Regex;

use source::utils::read;
use crate::source::utils::read;

lazy_static! {
pub static ref SENTENCE_BREAK_DATA: SentenceBreakData = {
Expand Down
2 changes: 1 addition & 1 deletion gen/src/source/ucd/test/grapheme_break_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use std::str::FromStr;

use itertools::Itertools;

use source::utils::read;
use crate::source::utils::read;

use regex::Regex;

Expand Down
2 changes: 1 addition & 1 deletion gen/src/source/ucd/test/normalization_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use std::char;
use std::str::FromStr;

use source::utils::read;
use crate::source::utils::read;

use regex::Regex;

Expand Down
2 changes: 1 addition & 1 deletion gen/src/source/ucd/test/word_break_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use std::str::FromStr;

use itertools::Itertools;

use source::utils::read;
use crate::source::utils::read;

use regex::Regex;

Expand Down
2 changes: 1 addition & 1 deletion gen/src/source/ucd/unicode_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use std::str::FromStr;

use regex::Regex;

use source::utils::read;
use crate::source::utils::read;

lazy_static! {
pub static ref UNICODE_DATA: UnicodeData = {
Expand Down
2 changes: 1 addition & 1 deletion gen/src/source/ucd/word_break_property.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use std::str::FromStr;

use regex::Regex;

use source::utils::read;
use crate::source::utils::read;

lazy_static! {
pub static ref WORD_BREAK_DATA: WordBreakData = {
Expand Down
4 changes: 2 additions & 2 deletions gen/src/writer/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

use std::path::Path;

use source::common::unicode_version::UnicodeVersion;
use crate::source::common::unicode_version::UnicodeVersion;

use writer::utils::write;
use crate::writer::utils::write;

pub fn emit_unicode_version(dir: &Path, unicode_version: &UnicodeVersion) {
write(
Expand Down
8 changes: 4 additions & 4 deletions gen/src/writer/emoji/char.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

use std::path::Path;

use source::emoji::emoji_data::EMOJI_DATA;
use source::emoji::readme::{EmojiDataVersion, EMOJI_VERSION};
use crate::source::emoji::emoji_data::EMOJI_DATA;
use crate::source::emoji::readme::{EmojiDataVersion, EMOJI_VERSION};

use writer::utils::tables::ToRangeCharSet;
use writer::utils::write;
use crate::writer::utils::tables::ToRangeCharSet;
use crate::writer::utils::write;

pub fn generate(dir: &Path) {
emit_emoji_data_version(dir, &EMOJI_VERSION);
Expand Down
2 changes: 1 addition & 1 deletion gen/src/writer/emoji/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

mod char;

use writer::utils::clean_dir;
use crate::writer::utils::clean_dir;

pub fn generate() {
char::generate(&clean_dir("unic/emoji/char/tables"));
Expand Down
10 changes: 5 additions & 5 deletions gen/src/writer/idna/mapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

use std::path::Path;

use source::idna::idna_mapping_table::IDNA_MAPPING;
use source::idna::readme::UNICODE_VERSION;
use crate::source::idna::idna_mapping_table::IDNA_MAPPING;
use crate::source::idna::readme::UNICODE_VERSION;

use writer::common::emit_unicode_version;
use writer::utils::tables::ToRangeCharTable;
use writer::utils::write;
use crate::writer::common::emit_unicode_version;
use crate::writer::utils::tables::ToRangeCharTable;
use crate::writer::utils::write;

pub fn generate(dir: &Path) {
emit_unicode_version(dir, &UNICODE_VERSION);
Expand Down
2 changes: 1 addition & 1 deletion gen/src/writer/idna/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

mod mapping;

use writer::utils::clean_dir;
use crate::writer::utils::clean_dir;

pub fn generate() {
mapping::generate(&clean_dir("unic/idna/mapping/tables"));
Expand Down
2 changes: 1 addition & 1 deletion gen/src/writer/normal/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

mod normal_tests;

use writer::utils::clean_dir;
use crate::writer::utils::clean_dir;

pub fn generate() {
normal_tests::generate(&clean_dir("unic/normal/tests/tables"));
Expand Down
4 changes: 2 additions & 2 deletions gen/src/writer/normal/normal_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
use std::fmt::Write;
use std::path::Path;

use source::ucd::test::normalization_test::NORMALIZATION_TESTS;
use crate::source::ucd::test::normalization_test::NORMALIZATION_TESTS;

use writer::utils::write;
use crate::writer::utils::write;

pub fn generate(dir: &Path) {
emit_conformance_tests_data(dir);
Expand Down
2 changes: 1 addition & 1 deletion gen/src/writer/segment/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

mod segment_tests;

use writer::utils::clean_dir;
use crate::writer::utils::clean_dir;

pub fn generate() {
segment_tests::generate(&clean_dir("unic/segment/tests/tables"));
Expand Down
6 changes: 3 additions & 3 deletions gen/src/writer/segment/segment_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@

use std::path::Path;

use source::ucd::test::grapheme_break_test::{GraphemeBreakTest, GRAPHEME_BREAK_TESTS};
use source::ucd::test::word_break_test::{WordBreakTest, WORD_BREAK_TESTS};
use crate::source::ucd::test::grapheme_break_test::{GraphemeBreakTest, GRAPHEME_BREAK_TESTS};
use crate::source::ucd::test::word_break_test::{WordBreakTest, WORD_BREAK_TESTS};

use writer::utils::write;
use crate::writer::utils::write;

pub fn generate(dir: &Path) {
emit_grapheme_cluster_break_test_data(dir);
Expand Down
10 changes: 5 additions & 5 deletions gen/src/writer/ucd/age.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
use std::fmt::Display;
use std::path::Path;

use source::ucd::derived_age::AGE_DATA;
use source::ucd::readme::UNICODE_VERSION;
use crate::source::ucd::derived_age::AGE_DATA;
use crate::source::ucd::readme::UNICODE_VERSION;

use writer::common::emit_unicode_version;
use writer::utils::tables::ToRangeCharTable;
use writer::utils::write;
use crate::writer::common::emit_unicode_version;
use crate::writer::utils::tables::ToRangeCharTable;
use crate::writer::utils::write;

pub fn generate(dir: &Path) {
emit_unicode_version(dir, &UNICODE_VERSION);
Expand Down
Loading

0 comments on commit 10ca3c8

Please sign in to comment.