Skip to content

Commit 29ecd77

Browse files
committed
Fix to work on Rust 1.24.0 again and remove unused imports.
1 parent 98fd158 commit 29ecd77

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

scripts/unicode.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ def emit_break_module(f, break_table, break_cats, name):
281281
f.write(""" }
282282
283283
fn bsearch_range_value_table(c: char, r: &'static [(char, char, %sCat)]) -> (u32, u32, %sCat) {
284+
use core;
284285
use core::cmp::Ordering::{Equal, Less, Greater};
285286
match r.binary_search_by(|&(lo, hi, _)| {
286287
if lo <= c && c <= hi { Equal }

src/grapheme.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,6 @@ impl GraphemeCursor {
566566
/// assert_eq!(cursor.next_boundary(&s[2..4], 2), Ok(None));
567567
/// ```
568568
pub fn next_boundary(&mut self, chunk: &str, chunk_start: usize) -> Result<Option<usize>, GraphemeIncomplete> {
569-
use tables::grapheme as gr;
570569
if self.offset == self.len {
571570
return Ok(None);
572571
}
@@ -642,7 +641,6 @@ impl GraphemeCursor {
642641
/// assert_eq!(cursor.prev_boundary(&s[0..2], 0), Ok(None));
643642
/// ```
644643
pub fn prev_boundary(&mut self, chunk: &str, chunk_start: usize) -> Result<Option<usize>, GraphemeIncomplete> {
645-
use tables::grapheme as gr;
646644
if self.offset == 0 {
647645
return Ok(None);
648646
}

src/tables.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ pub mod grapheme {
346346
}
347347

348348
fn bsearch_range_value_table(c: char, r: &'static [(char, char, GraphemeCat)]) -> (u32, u32, GraphemeCat) {
349+
use core;
349350
use core::cmp::Ordering::{Equal, Less, Greater};
350351
match r.binary_search_by(|&(lo, hi, _)| {
351352
if lo <= c && c <= hi { Equal }
@@ -987,6 +988,7 @@ pub mod word {
987988
}
988989

989990
fn bsearch_range_value_table(c: char, r: &'static [(char, char, WordCat)]) -> (u32, u32, WordCat) {
991+
use core;
990992
use core::cmp::Ordering::{Equal, Less, Greater};
991993
match r.binary_search_by(|&(lo, hi, _)| {
992994
if lo <= c && c <= hi { Equal }
@@ -1452,6 +1454,7 @@ pub mod emoji {
14521454
}
14531455

14541456
fn bsearch_range_value_table(c: char, r: &'static [(char, char, EmojiCat)]) -> (u32, u32, EmojiCat) {
1457+
use core;
14551458
use core::cmp::Ordering::{Equal, Less, Greater};
14561459
match r.binary_search_by(|&(lo, hi, _)| {
14571460
if lo <= c && c <= hi { Equal }
@@ -1554,6 +1557,7 @@ pub mod sentence {
15541557
}
15551558

15561559
fn bsearch_range_value_table(c: char, r: &'static [(char, char, SentenceCat)]) -> (u32, u32, SentenceCat) {
1560+
use core;
15571561
use core::cmp::Ordering::{Equal, Less, Greater};
15581562
match r.binary_search_by(|&(lo, hi, _)| {
15591563
if lo <= c && c <= hi { Equal }

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy