10
10
11
11
use core:: cmp;
12
12
13
- use tables:: grapheme:: GraphemeCat ;
13
+ use crate :: tables:: grapheme:: GraphemeCat ;
14
14
15
15
/// External iterator for grapheme clusters and byte offsets.
16
16
///
@@ -229,7 +229,7 @@ enum PairResult {
229
229
}
230
230
231
231
fn check_pair ( before : GraphemeCat , after : GraphemeCat ) -> PairResult {
232
- use tables:: grapheme:: GraphemeCat :: * ;
232
+ use crate :: tables:: grapheme:: GraphemeCat :: * ;
233
233
use self :: PairResult :: * ;
234
234
match ( before, after) {
235
235
( GC_CR , GC_LF ) => NotBreak , // GB3
@@ -295,8 +295,8 @@ impl GraphemeCursor {
295
295
}
296
296
297
297
fn grapheme_category ( & mut self , ch : char ) -> GraphemeCat {
298
- use tables:: grapheme as gr;
299
- use tables:: grapheme:: GraphemeCat :: * ;
298
+ use crate :: tables:: grapheme as gr;
299
+ use crate :: tables:: grapheme:: GraphemeCat :: * ;
300
300
301
301
if ch <= '\u{7e}' {
302
302
// Special-case optimization for ascii, except U+007F. This
@@ -387,7 +387,7 @@ impl GraphemeCursor {
387
387
/// assert_eq!(cursor.is_boundary(&flags[8..], 8), Ok(true));
388
388
/// ```
389
389
pub fn provide_context ( & mut self , chunk : & str , chunk_start : usize ) {
390
- use tables:: grapheme as gr;
390
+ use crate :: tables:: grapheme as gr;
391
391
assert ! ( chunk_start + chunk. len( ) == self . pre_context_offset. unwrap( ) ) ;
392
392
self . pre_context_offset = None ;
393
393
if self . is_extended && chunk_start + chunk. len ( ) == self . offset {
@@ -433,7 +433,7 @@ impl GraphemeCursor {
433
433
}
434
434
435
435
fn handle_regional ( & mut self , chunk : & str , chunk_start : usize ) {
436
- use tables:: grapheme as gr;
436
+ use crate :: tables:: grapheme as gr;
437
437
let mut ris_count = self . ris_count . unwrap_or ( 0 ) ;
438
438
for ch in chunk. chars ( ) . rev ( ) {
439
439
if self . grapheme_category ( ch) != gr:: GC_Regional_Indicator {
@@ -453,7 +453,7 @@ impl GraphemeCursor {
453
453
}
454
454
455
455
fn handle_emoji ( & mut self , chunk : & str , chunk_start : usize ) {
456
- use tables:: grapheme as gr;
456
+ use crate :: tables:: grapheme as gr;
457
457
let mut iter = chunk. chars ( ) . rev ( ) ;
458
458
if let Some ( ch) = iter. next ( ) {
459
459
if self . grapheme_category ( ch) != gr:: GC_ZWJ {
@@ -506,7 +506,7 @@ impl GraphemeCursor {
506
506
/// assert_eq!(cursor.is_boundary(flags, 0), Ok(false));
507
507
/// ```
508
508
pub fn is_boundary ( & mut self , chunk : & str , chunk_start : usize ) -> Result < bool , GraphemeIncomplete > {
509
- use tables:: grapheme as gr;
509
+ use crate :: tables:: grapheme as gr;
510
510
if self . state == GraphemeState :: Break {
511
511
return Ok ( true )
512
512
}
0 commit comments