Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rust 1.17.0 #41

Merged
merged 3 commits into from
Jun 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.15.0
- 1.17.0

matrix:
fast_finish: true
Expand Down
2 changes: 1 addition & 1 deletion examples/flame_udhr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use unicode_bidi::BidiInfo;

#[cfg(feature = "flame_it")]
fn main() {
const BIDI_TEXT: &'static str = include_str!("../data/udhr/bidi/udhr_pes_1.txt");
const BIDI_TEXT: str = include_str!("../data/udhr/bidi/udhr_pes_1.txt");

flame::start("main(): BidiInfo::new()");
let bidi_info = BidiInfo::new(BIDI_TEXT, None);
Expand Down
2 changes: 1 addition & 1 deletion src/char_data/tables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub enum BidiClass {
}

use self::BidiClass::*;
pub const bidi_class_table: &'static [(char, char, BidiClass)] = &[
pub const bidi_class_table: &[(char, char, BidiClass)] = &[
('\u{0}', '\u{8}', BN), ('\u{9}', '\u{9}', S), ('\u{a}', '\u{a}', B), ('\u{b}', '\u{b}', S),
('\u{c}', '\u{c}', WS), ('\u{d}', '\u{d}', B), ('\u{e}', '\u{1b}', BN), ('\u{1c}', '\u{1e}', B),
('\u{1f}', '\u{1f}', S), ('\u{20}', '\u{20}', WS), ('\u{21}', '\u{22}', ON), ('\u{23}',
Expand Down
4 changes: 2 additions & 2 deletions src/explicit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ impl DirectionalStatusStack {

fn push(&mut self, level: Level, status: OverrideStatus) {
self.vec.push(Status {
level: level,
status: status,
level,
status,
});
}

Expand Down
34 changes: 17 additions & 17 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,9 @@ impl<'text> InitialInfo<'text> {
flame::end("InitialInfo::new(): iter text.char_indices()");

InitialInfo {
text: text,
original_classes: original_classes,
paragraphs: paragraphs,
text,
original_classes,
paragraphs,
}
}
}
Expand Down Expand Up @@ -304,10 +304,10 @@ impl<'text> BidiInfo<'text> {
}

BidiInfo {
text: text,
original_classes: original_classes,
paragraphs: paragraphs,
levels: levels,
text,
original_classes,
paragraphs,
levels,
}
}

Expand Down Expand Up @@ -503,7 +503,7 @@ mod tests {
assert_eq!(
InitialInfo::new(text, None),
InitialInfo {
text: &text,
text,
original_classes: vec![L, EN],
paragraphs: vec![
ParagraphInfo {
Expand All @@ -518,7 +518,7 @@ mod tests {
assert_eq!(
InitialInfo::new(text, None),
InitialInfo {
text: &text,
text,
original_classes: vec![AL, AL, WS, R, R],
paragraphs: vec![
ParagraphInfo {
Expand All @@ -533,7 +533,7 @@ mod tests {
assert_eq!(
InitialInfo::new(text, None),
InitialInfo {
text: &text,
text,
original_classes: vec![L, B, B, B, L],
paragraphs: vec![
ParagraphInfo {
Expand Down Expand Up @@ -570,7 +570,7 @@ mod tests {
assert_eq!(
BidiInfo::new(text, Some(LTR_LEVEL)),
BidiInfo {
text: &text,
text,
levels: Level::vec(&[0, 0, 0, 0, 0, 0]),
original_classes: vec![L, L, L, EN, EN, EN],
paragraphs: vec![
Expand All @@ -586,7 +586,7 @@ mod tests {
assert_eq!(
BidiInfo::new(text, Some(LTR_LEVEL)),
BidiInfo {
text: &text,
text,
levels: Level::vec(&[0, 0, 0, 0, 1, 1, 1, 1, 1, 1]),
original_classes: vec![L, L, L, WS, R, R, R, R, R, R],
paragraphs: vec![
Expand All @@ -600,7 +600,7 @@ mod tests {
assert_eq!(
BidiInfo::new(text, Some(RTL_LEVEL)),
BidiInfo {
text: &text,
text,
levels: Level::vec(&[2, 2, 2, 1, 1, 1, 1, 1, 1, 1]),
original_classes: vec![L, L, L, WS, R, R, R, R, R, R],
paragraphs: vec![
Expand All @@ -616,7 +616,7 @@ mod tests {
assert_eq!(
BidiInfo::new(text, Some(LTR_LEVEL)),
BidiInfo {
text: &text,
text,
levels: Level::vec(&[1, 1, 1, 1, 1, 1, 0, 0, 0, 0]),
original_classes: vec![R, R, R, R, R, R, WS, L, L, L],
paragraphs: vec![
Expand All @@ -630,7 +630,7 @@ mod tests {
assert_eq!(
BidiInfo::new(text, None),
BidiInfo {
text: &text,
text,
levels: Level::vec(&[1, 1, 1, 1, 1, 1, 1, 2, 2, 2]),
original_classes: vec![R, R, R, R, R, R, WS, L, L, L],
paragraphs: vec![
Expand All @@ -646,7 +646,7 @@ mod tests {
assert_eq!(
BidiInfo::new(text, Some(LTR_LEVEL)),
BidiInfo {
text: &text,
text,
levels: Level::vec(&[1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1]),
original_classes: vec![AL, AL, EN, AL, AL, WS, R, R, EN, R, R],
paragraphs: vec![
Expand All @@ -662,7 +662,7 @@ mod tests {
assert_eq!(
BidiInfo::new(text, None),
BidiInfo {
text: &text,
text,
original_classes: vec![L, WS, R, R, CS, B, R, R],
levels: Level::vec(&[0, 0, 1, 1, 0, 0, 1, 1]),
paragraphs: vec![
Expand Down
8 changes: 4 additions & 4 deletions tests/conformance_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ fn test_basic_conformance() {
if levels != exp_levels {
fails.push(Fail {
line_num: line_idx + 1,
input_base_level: input_base_level,
input_base_level,
input_classes: input_classes.iter().map(|x| x.to_string()).collect(),
input_string: input_string.to_owned(),
exp_base_level: None,
Expand Down Expand Up @@ -132,7 +132,7 @@ fn test_basic_conformance() {
// TODO: Support auto-RTL
fn gen_base_levels_for_base_tests(bitset: u8) -> Vec<Option<Level>> {
/// Values: auto-LTR, LTR, RTL
const VALUES: &'static [Option<Level>] =
const VALUES: &[Option<Level>] =
&[None, Some(level::LTR_LEVEL), Some(level::RTL_LEVEL)];
assert!(bitset < (1 << VALUES.len()));
(0..VALUES.len())
Expand Down Expand Up @@ -185,7 +185,7 @@ fn test_character_conformance() {
if levels != exp_levels {
fails.push(Fail {
line_num: line_idx + 1,
input_base_level: input_base_level,
input_base_level,
input_classes: vec![],
input_string: input_string.to_owned(),
exp_base_level: Some(exp_base_level),
Expand Down Expand Up @@ -227,7 +227,7 @@ fn test_character_conformance() {
// TODO: Support auto-RTL
fn gen_base_level_for_characters_tests(idx: usize) -> Option<Level> {
/// Values: LTR, RTL, auto-LTR
const VALUES: &'static [Option<Level>] =
const VALUES: &[Option<Level>] =
&[Some(level::LTR_LEVEL), Some(level::RTL_LEVEL), None];
assert!(idx < VALUES.len());
VALUES[idx]
Expand Down