Skip to content

Commit c8352ab

Browse files
bors[bot]behnam
andcommitted
229: Fix compile errors and update project metadata r=behnam a=behnam Bumping minimum-rust-version to 1.24.0, because of compile failures on some dependencies. Updating all docs/badges links to the new home: <https://github.com/open-i18n/rust-unic>. Co-authored-by: Behnam Esfahbod <[email protected]>
2 parents f43e463 + 0e25f35 commit c8352ab

File tree

123 files changed

+643
-604
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+643
-604
lines changed

.rustfmt.toml

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
brace_style = "SameLineWhere"
2-
imports_indent = "Block"
31
imports_layout = "HorizontalVertical"
4-
indent_style = "Block"
52
max_width = 100
6-
reorder_imported_names = true
7-
reorder_imports = true
8-
reorder_imports_in_group = true
3+
reorder_impl_items = true

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ rust:
77
- nightly
88
- beta
99
- stable
10-
- 1.22.0 # = MIN_RUST_VERSION
10+
- 1.24.0 # = MIN_RUST_VERSION
1111

1212
branches:
1313
except:

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ Thank you for your interest in contributing to UNIC! There are many ways to
44
contribute, and we appreciate all of them.
55

66
If you have questions, please ask on the [Gitter
7-
room](https://gitter.im/behnam/rust-unic) or join the [IRC channel
7+
room](https://gitter.im/open-i18n/rust-unic) or join the [IRC channel
88
\#unic](http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23unic).
99

1010
## Feature Requests and Bug Reports
1111

1212
To request for new components or new features for the existing components, or to
1313
report a bug, please [file an issue on
14-
GitHub](https://github.com/behnam/rust-unic/issues/new).
14+
GitHub](https://github.com/open-i18n/rust-unic/issues/new).
1515

1616
## Code Organization
1717

README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
# UNIC: Unicode and Internationalization Crates for Rust
22

3-
[![UNIC-logo](docs/images/UNIC-logo.png)](https://github.com/behnam/rust-unic/)
3+
[![UNIC-logo](docs/images/UNIC-logo.png)](https://github.com/open-i18n/rust-unic/)
44

5-
[![Travis](https://img.shields.io/travis/behnam/rust-unic/master.svg?label=Linux%20build)](https://travis-ci.org/behnam/rust-unic/)
6-
[![AppVeyor](https://img.shields.io/appveyor/ci/behnam/rust-unic/master.svg?label=Windows%20build)](https://ci.appveyor.com/project/behnam/rust-unic)
7-
[![Rust-1.22.0+](https://img.shields.io/badge/rustc-1.22+-red.svg#MIN_RUST_VERSION)](https://www.rust-lang.org/)
5+
[![Travis](https://img.shields.io/travis/open-i18n/rust-unic/master.svg?label=Linux%20build)](https://travis-ci.org/open-i18n/rust-unic/)
6+
[![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)
7+
[![Rust-1.24.0+](https://img.shields.io/badge/rustc-1.24+-red.svg#MIN_RUST_VERSION)](https://www.rust-lang.org/)
88
[![Unicode-10.0.0](https://img.shields.io/badge/unicode-10.0.0-red.svg)](https://www.unicode.org/versions/Unicode10.0.0/)
9-
[![Release](https://img.shields.io/github/release/behnam/rust-unic.svg)](https://github.com/behnam/rust-unic/)
9+
[![Release](https://img.shields.io/github/release/open-i18n/rust-unic.svg)](https://github.com/open-i18n/rust-unic/)
1010
[![Crates.io](https://img.shields.io/crates/v/unic.svg)](https://crates.io/crates/unic/)
1111
[![Documentation](https://docs.rs/unic/badge.svg)](https://docs.rs/unic/)
12-
[![Gitter](https://img.shields.io/gitter/room/behnam/rust-unic.svg)](https://gitter.im/behnam/rust-unic)
12+
[![Gitter](https://img.shields.io/gitter/room/open-i18n/rust-unic.svg)](https://gitter.im/open-i18n/rust-unic)
1313

14-
<https://github.com/behnam/rust-unic>
14+
<https://github.com/open-i18n/rust-unic>
1515

1616
**UNIC** is a project to develop components for the Rust programming language
1717
to provide high-quality and easy-to-use crates for Unicode
@@ -34,7 +34,7 @@ needed by Unicode/CLDR components, or common demand.
3434

3535
At the moment UNIC is under heavy development: the API is updated frequently on
3636
`master` branch, and there will be API breakage between each `0.x` release.
37-
Please see [open issues](https://github.com/behnam/rust-unic/issues) for changes
37+
Please see [open issues](https://github.com/open-i18n/rust-unic/issues) for changes
3838
planed.
3939

4040
We expect to have the `1.0` version released in 2018 and maintain a stable API

apps/cli/Cargo.toml

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "unic-cli"
33
version = "0.7.0"
44
authors = ["The UNIC Project Developers"]
5-
repository = "https://github.com/behnam/rust-unic/"
5+
repository = "https://github.com/open-i18n/rust-unic/"
66
license = "MIT/Apache-2.0"
77
description = "UNIC Command-Line Tools"
88
keywords = ["text", "unicode", "internationalization"]
@@ -23,7 +23,7 @@ quickcheck = "0.6"
2323

2424
[badges]
2525
maintenance = { status = "actively-developed" }
26-
is-it-maintained-issue-resolution = { repository = "behnam/rust-unic" }
27-
is-it-maintained-open-issues = { repository = "behnam/rust-unic" }
28-
appveyor = { repository = "behnam/rust-unic", branch = "master", service = "github" }
29-
travis-ci = { repository = "behnam/rust-unic", branch = "master" }
26+
is-it-maintained-issue-resolution = { repository = "open-i18n/rust-unic" }
27+
is-it-maintained-open-issues = { repository = "open-i18n/rust-unic" }
28+
appveyor = { repository = "open-i18n/rust-unic", branch = "master", service = "github" }
29+
travis-ci = { repository = "open-i18n/rust-unic", branch = "master" }

apps/cli/src/bin/unic-echo.rs

+13-18
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ unic_arg_enum!{
3232
}
3333
}
3434

35-
macro_rules! input_formats_help{
36-
() => {"\
37-
INPUT FORMATS:
35+
macro_rules! input_formats_help {
36+
() => {
37+
"INPUT FORMATS:
3838
plain [default] Plain Unicode characters
3939
codepoints Unicode codepoints (hex)
4040
utf8-hex UTF-8 bytes (hex)
4141
utf16-hex UTF-16 words (hex)
4242
"
43-
}
43+
};
4444
}
4545

4646
unic_arg_enum!{
@@ -68,9 +68,9 @@ unic_arg_enum!{
6868
}
6969
}
7070

71-
macro_rules! output_formats_help{
72-
() => {"\
73-
OUTPUT FORMATS:
71+
macro_rules! output_formats_help {
72+
() => {
73+
"OUTPUT FORMATS:
7474
plain [default] Plain Unicode characters
7575
codepoints Unicode codepoints (hex)
7676
utf8-hex UTF-8 bytes (hex)
@@ -88,7 +88,7 @@ OUTPUT FORMATS:
8888
| js6-escape-control control characters
8989
| rust-escape-control
9090
"
91-
}
91+
};
9292
}
9393

9494
fn main() {
@@ -101,35 +101,30 @@ fn run() -> Result<()> {
101101
env!("CARGO_PKG_DESCRIPTION"),
102102
"\n\n",
103103
"Write arguments to the standard output",
104-
))
105-
.arg(
104+
)).arg(
106105
Arg::with_name("no_newline")
107106
.short("n")
108107
.long("no-newline")
109108
.help("No trailing newline"),
110-
)
111-
.arg(
109+
).arg(
112110
Arg::with_name("STRINGS")
113111
.multiple(true)
114112
.help("Input strings (expected valid Unicode)"),
115-
)
116-
.arg(
113+
).arg(
117114
Arg::with_name("input_format")
118115
.short("i")
119116
.long("input")
120117
.takes_value(true)
121118
.value_name("FORMAT")
122119
.help("Specify input format (see list below)"),
123-
)
124-
.arg(
120+
).arg(
125121
Arg::with_name("output_format")
126122
.short("o")
127123
.long("output")
128124
.takes_value(true)
129125
.value_name("FORMAT")
130126
.help("Specify output format (see list below)"),
131-
)
132-
.after_help(concat!(input_formats_help!(), "\n", output_formats_help!()));
127+
).after_help(concat!(input_formats_help!(), "\n", output_formats_help!()));
133128
let matches = app.get_matches();
134129

135130
// == Read input ==

apps/cli/src/bin/unic-inspector.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ extern crate unic;
1818
extern crate unic_cli;
1919

2020
use clap::Arg;
21-
use prettytable::Table;
2221
use prettytable::format::TableFormat;
22+
use prettytable::Table;
2323

2424
use unic::char::property::EnumeratedCharProperty;
2525
use unic::ucd::{GeneralCategory, Name};
@@ -30,8 +30,7 @@ fn main() {
3030
env!("CARGO_PKG_DESCRIPTION"),
3131
"\n\n",
3232
"Inspect characters and their properties",
33-
))
34-
.arg(
33+
)).arg(
3534
Arg::with_name("STRINGS")
3635
.help("Input strings (expected valid Unicode)")
3736
.multiple(true),

apps/cli/src/bin/unic-versions.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -15,67 +15,67 @@
1515
extern crate unic;
1616

1717
macro_rules! print_component_desc {
18-
( $component:tt ) => (
18+
( $component:tt ) => {
1919
println!("Component: {}", unic::$component::PKG_DESCRIPTION);
20-
);
20+
};
2121
}
2222

2323
macro_rules! print_component_name_version {
24-
( $component:tt ) => (
24+
( $component:tt ) => {
2525
println!(
2626
"Package: {} ({})",
2727
unic::$component::PKG_NAME,
2828
unic::$component::PKG_VERSION
2929
);
30-
);
30+
};
3131
}
3232

3333
macro_rules! print_unicode_version {
34-
( $component:tt ) => (
34+
( $component:tt ) => {
3535
println!(
3636
"Unicode Version: {}.{}.{}",
3737
unic::$component::UNICODE_VERSION.major,
3838
unic::$component::UNICODE_VERSION.minor,
3939
unic::$component::UNICODE_VERSION.micro
4040
);
41-
);
41+
};
4242
}
4343

4444
macro_rules! print_emoji_version {
45-
( $component:tt ) => (
45+
( $component:tt ) => {
4646
println!(
4747
"Emoji Version: {}.{}.{}",
4848
unic::$component::EMOJI_VERSION.major,
4949
unic::$component::EMOJI_VERSION.minor,
5050
unic::$component::EMOJI_VERSION.micro
5151
);
52-
);
52+
};
5353
}
5454

5555
macro_rules! print_component_info {
56-
( $component:tt ) => (
56+
( $component:tt ) => {
5757
print_component_desc!($component);
5858
print_component_name_version!($component);
5959
println!();
60-
);
60+
};
6161
}
6262

6363
macro_rules! print_component_info_with_unicode_version {
64-
( $component:tt ) => (
64+
( $component:tt ) => {
6565
print_component_desc!($component);
6666
print_component_name_version!($component);
6767
print_unicode_version!($component);
6868
println!();
69-
);
69+
};
7070
}
7171

7272
macro_rules! print_component_info_with_emoji_version {
73-
( $component:tt ) => (
73+
( $component:tt ) => {
7474
print_component_desc!($component);
7575
print_component_name_version!($component);
7676
print_emoji_version!($component);
7777
println!();
78-
);
78+
};
7979
}
8080

8181
fn main() {

apps/cli/src/clap_macros.rs

-4
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ macro_rules! unic_arg_enum {
2020
type Err = String;
2121

2222
fn from_str(s: &str) -> ::std::result::Result<Self,Self::Err> {
23-
// TODO(MIN_RUST_VERSION): Drop following after >= 1.23
24-
#[allow(unused_imports)]
25-
use ::std::ascii::AsciiExt;
26-
2723
match s {
2824
$(stringify!($v) |
2925
_ if s.replace("-", "").eq_ignore_ascii_case(stringify!($v)) => Ok($e::$v)),+,

apps/cli/src/parsers.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ pub fn codepoints(string: &str) -> String {
3939
.expect(&format!("Cannot parse token as hex number: {}", token));
4040
char::from_u32(codepoint) //.
4141
.expect(&format!("Invalid Unicode Scalar Value code-point: {}", codepoint))
42-
})
43-
.collect::<String>()
42+
}).collect::<String>()
4443
}
4544

4645
pub fn utf8_hex(string: &str) -> String {

data/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "unic-data"
33
version = "0.0.0"
44
authors = ["The UNIC Project Developers"]
5-
repository = "https://github.com/behnam/rust-unic/"
5+
repository = "https://github.com/open-i18n/rust-unic/"
66
license = "MIT/Apache-2.0"
77
description = "UNIC - Source Data Download Script"
88
publish = false

data/src/client.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ use std::error::Error;
1212
use std::fs::File;
1313
use std::io::Write;
1414

15-
use futures::{Future, Stream};
1615
use futures::future::join_all;
16+
use futures::{Future, Stream};
1717
use hyper::{Client, Uri};
1818
use tokio_core::reactor::Core;
1919

@@ -43,11 +43,9 @@ pub fn download_all(download_paths: &[DownloadMap]) -> Result<(), Box<Error>> {
4343
.map(move |mut file| {
4444
res.body()
4545
.for_each(move |chunk| file.write_all(&chunk).map_err(From::from))
46-
})
47-
.expect("Failed to create file")
46+
}).expect("Failed to create file")
4847
})
49-
})
50-
.expect("Invalid URI")
48+
}).expect("Invalid URI")
5149
});
5250

5351
core.run(join_all(jobs))?;

docs/Unicode_and_Rust.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,4 @@ any mixing, or ensure and verify that it is safe to do so.
119119
- [unicode-rs](https://github.com/unicode-rs)
120120

121121
- [UNIC: Unicode and Internationalization Crates for
122-
Rust](https://github.com/behnam/rust-unic/)
122+
Rust](https://github.com/open-i18n/rust-unic/)

gen/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "unic-gen"
33
version = "0.0.0"
44
authors = ["The UNIC Project Developers"]
5-
repository = "https://github.com/behnam/rust-unic/"
5+
repository = "https://github.com/open-i18n/rust-unic/"
66
license = "MIT/Apache-2.0"
77
description = "UNIC — Table Generation"
88
publish = false

gen/src/source/common/unicode_version.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ impl FromStr for UnicodeVersion {
3232
major: m[1].parse().unwrap(),
3333
minor: m[2].parse().unwrap(),
3434
micro: m[3].parse().unwrap(),
35-
})
36-
.ok_or(())
35+
}).ok_or(())
3736
}
3837
}

gen/src/source/emoji/emoji_data.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ use source::ucd::BINARY_PROPERTIES_REGEX;
1616
use source::utils::read;
1717

1818
lazy_static! {
19-
pub static ref EMOJI_DATA: EmojiData = {
20-
read("data/emoji/emoji-data.txt").parse().unwrap()
21-
};
19+
pub static ref EMOJI_DATA: EmojiData = { read("data/emoji/emoji-data.txt").parse().unwrap() };
2220
}
2321

2422
/// Emoji Character Properties

gen/src/source/emoji/readme.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@ pub struct EmojiDataVersion {
2121
}
2222

2323
lazy_static! {
24-
pub static ref EMOJI_VERSION: EmojiDataVersion = {
25-
read("data/emoji/ReadMe.txt").parse().unwrap()
26-
};
24+
pub static ref EMOJI_VERSION: EmojiDataVersion =
25+
{ read("data/emoji/ReadMe.txt").parse().unwrap() };
2726
}
2827

2928
impl FromStr for EmojiDataVersion {
@@ -40,7 +39,6 @@ impl FromStr for EmojiDataVersion {
4039
major: m[1].parse().unwrap(),
4140
minor: m[2].parse().unwrap(),
4241
micro: 0,
43-
})
44-
.ok_or(())
42+
}).ok_or(())
4543
}
4644
}

gen/src/source/idna/idna_mapping_table.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ use regex::Regex;
1717
use source::utils::read;
1818

1919
lazy_static! {
20-
pub static ref IDNA_MAPPING: IdnaMapping = {
21-
read("data/idna/IdnaMappingTable.txt").parse().unwrap()
22-
};
20+
pub static ref IDNA_MAPPING: IdnaMapping =
21+
{ read("data/idna/IdnaMappingTable.txt").parse().unwrap() };
2322
}
2423

2524
#[derive(Clone, Debug, Eq, PartialEq)]

0 commit comments

Comments
 (0)