Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7883b57

Browse files
committed
Run cargo fix
1 parent3be7fa9 commit7883b57

File tree

5 files changed

+26
-26
lines changed

5 files changed

+26
-26
lines changed

‎src/grapheme.rs‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
use core::cmp;
1212

13-
use tables::grapheme::GraphemeCat;
13+
usecrate::tables::grapheme::GraphemeCat;
1414

1515
/// External iterator for grapheme clusters and byte offsets.
1616
#[derive(Clone)]
@@ -215,7 +215,7 @@ enum PairResult {
215215
}
216216

217217
fncheck_pair(before:GraphemeCat,after:GraphemeCat) ->PairResult{
218-
use tables::grapheme::GraphemeCat::*;
218+
usecrate::tables::grapheme::GraphemeCat::*;
219219
useself::PairResult::*;
220220
match(before, after){
221221
(GC_CR,GC_LF) =>NotBreak,// GB3
@@ -348,7 +348,7 @@ impl GraphemeCursor {
348348
/// assert_eq!(cursor.is_boundary(&flags[8..], 8), Ok(true));
349349
/// ```
350350
pubfnprovide_context(&mutself,chunk:&str,chunk_start:usize){
351-
use tables::graphemeas gr;
351+
usecrate::tables::graphemeas gr;
352352
assert!(chunk_start + chunk.len() ==self.pre_context_offset.unwrap());
353353
self.pre_context_offset =None;
354354
ifself.is_extended && chunk_start + chunk.len() ==self.offset{
@@ -394,7 +394,7 @@ impl GraphemeCursor {
394394
}
395395

396396
fnhandle_regional(&mutself,chunk:&str,chunk_start:usize){
397-
use tables::graphemeas gr;
397+
usecrate::tables::graphemeas gr;
398398
letmut ris_count =self.ris_count.unwrap_or(0);
399399
for chin chunk.chars().rev(){
400400
if gr::grapheme_category(ch) != gr::GC_Regional_Indicator{
@@ -414,7 +414,7 @@ impl GraphemeCursor {
414414
}
415415

416416
fnhandle_emoji(&mutself,chunk:&str,chunk_start:usize){
417-
use tables::graphemeas gr;
417+
usecrate::tables::graphemeas gr;
418418
for chin chunk.chars().rev(){
419419
match gr::grapheme_category(ch){
420420
gr::GC_Extend =>(),
@@ -460,7 +460,7 @@ impl GraphemeCursor {
460460
/// assert_eq!(cursor.is_boundary(flags, 0), Ok(false));
461461
/// ```
462462
pubfnis_boundary(&mutself,chunk:&str,chunk_start:usize) ->Result<bool,GraphemeIncomplete>{
463-
use tables::graphemeas gr;
463+
usecrate::tables::graphemeas gr;
464464
ifself.state ==GraphemeState::Break{
465465
returnOk(true)
466466
}
@@ -550,7 +550,7 @@ impl GraphemeCursor {
550550
/// assert_eq!(cursor.next_boundary(&s[2..4], 2), Ok(None));
551551
/// ```
552552
pubfnnext_boundary(&mutself,chunk:&str,chunk_start:usize) ->Result<Option<usize>,GraphemeIncomplete>{
553-
use tables::graphemeas gr;
553+
usecrate::tables::graphemeas gr;
554554
ifself.offset ==self.len{
555555
returnOk(None);
556556
}
@@ -626,7 +626,7 @@ impl GraphemeCursor {
626626
/// assert_eq!(cursor.prev_boundary(&s[0..2], 0), Ok(None));
627627
/// ```
628628
pubfnprev_boundary(&mutself,chunk:&str,chunk_start:usize) ->Result<Option<usize>,GraphemeIncomplete>{
629-
use tables::graphemeas gr;
629+
usecrate::tables::graphemeas gr;
630630
ifself.offset ==0{
631631
returnOk(None);
632632
}

‎src/lib.rs‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ extern crate std;
6363
#[macro_use]
6464
externcrate quickcheck;
6565

66-
pubuse grapheme::{Graphemes,GraphemeIndices};
67-
pubuse grapheme::{GraphemeCursor,GraphemeIncomplete};
68-
pubuse tables::UNICODE_VERSION;
69-
pubuse word::{UWordBounds,UWordBoundIndices,UnicodeWords};
70-
pubuse sentence::{USentenceBounds,USentenceBoundIndices,UnicodeSentences};
66+
pubusecrate::grapheme::{Graphemes,GraphemeIndices};
67+
pubusecrate::grapheme::{GraphemeCursor,GraphemeIncomplete};
68+
pubusecrate::tables::UNICODE_VERSION;
69+
pubusecrate::word::{UWordBounds,UWordBoundIndices,UnicodeWords};
70+
pubusecrate::sentence::{USentenceBounds,USentenceBoundIndices,UnicodeSentences};
7171

7272
mod grapheme;
7373
mod tables;

‎src/sentence.rs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use core::iter::Filter;
1313

1414
// All of the logic for forward iteration over sentences
1515
mod fwd{
16-
use tables::sentence::SentenceCat;
16+
usecrate::tables::sentence::SentenceCat;
1717
use core::cmp;
1818

1919
// Describe a parsed part of source string as described in this table:
@@ -111,7 +111,7 @@ mod fwd {
111111
if parts[idx] ==StatePart::ClosePlus{ idx -=1}
112112

113113
if parts[idx] ==StatePart::ATerm{
114-
use tables::sentenceas se;
114+
usecrate::tables::sentenceas se;
115115

116116
for next_charin ahead.chars(){
117117
//( ¬(OLetter | Upper | Lower | ParaSep | SATerm) )* Lower
@@ -176,7 +176,7 @@ mod fwd {
176176

177177
#[inline]
178178
fnnext(&mutself) ->Option<usize>{
179-
use tables::sentenceas se;
179+
usecrate::tables::sentenceas se;
180180

181181
for next_charinself.string[self.pos..].chars(){
182182
let position_before =self.pos;
@@ -313,7 +313,7 @@ pub fn new_sentence_bound_indices<'a>(source: &'a str) -> USentenceBoundIndices<
313313
#[inline]
314314
pubfnnew_unicode_sentences<'b>(s:&'bstr) ->UnicodeSentences<'b>{
315315
usesuper::UnicodeSegmentation;
316-
use tables::util::is_alphanumeric;
316+
usecrate::tables::util::is_alphanumeric;
317317

318318
fnhas_alphanumeric(s:&&str) ->bool{ s.chars().any(|c|is_alphanumeric(c))}
319319
let has_alphanumeric:fn(&&str) ->bool = has_alphanumeric;// coerce to fn pointer

‎src/test.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use std::prelude::v1::*;
1414

1515
#[test]
1616
fntest_graphemes(){
17-
use testdata::{TEST_SAME,TEST_DIFF};
17+
usecrate::testdata::{TEST_SAME,TEST_DIFF};
1818

1919
pubconstEXTRA_DIFF:&'static[(&'staticstr,
2020
&'static[&'staticstr],
@@ -88,7 +88,7 @@ fn test_graphemes() {
8888

8989
#[test]
9090
fntest_words(){
91-
use testdata::TEST_WORD;
91+
usecrate::testdata::TEST_WORD;
9292

9393
// Unicode's official tests don't really test longer chains of flag emoji
9494
// TODO This could be improved with more tests like flag emoji with interspersed Extend chars and ZWJ
@@ -144,7 +144,7 @@ fn test_words() {
144144

145145
#[test]
146146
fntest_sentences(){
147-
use testdata::TEST_SENTENCE;
147+
usecrate::testdata::TEST_SENTENCE;
148148

149149
for&(s, w)inTEST_SENTENCE.iter(){
150150
macro_rules! assert_{

‎src/word.rs‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use core::cmp;
1212
use core::iter::Filter;
1313

14-
use tables::word::WordCat;
14+
usecrate::tables::word::WordCat;
1515

1616
/// An iterator over the substrings of a string which, after splitting the string on
1717
/// [word boundaries](http://www.unicode.org/reports/tr29/#Word_Boundaries),
@@ -135,7 +135,7 @@ impl<'a> Iterator for UWordBounds<'a> {
135135
fnnext(&mutself) ->Option<&'astr>{
136136
useself::UWordBoundsState::*;
137137
useself::FormatExtendType::*;
138-
use tables::wordas wd;
138+
usecrate::tables::wordas wd;
139139
ifself.string.len() ==0{
140140
returnNone;
141141
}
@@ -364,7 +364,7 @@ impl<'a> DoubleEndedIterator for UWordBounds<'a> {
364364
fnnext_back(&mutself) ->Option<&'astr>{
365365
useself::UWordBoundsState::*;
366366
useself::FormatExtendType::*;
367-
use tables::wordas wd;
367+
usecrate::tables::wordas wd;
368368
ifself.string.len() ==0{
369369
returnNone;
370370
}
@@ -605,7 +605,7 @@ impl<'a> UWordBounds<'a> {
605605

606606
#[inline]
607607
fnget_next_cat(&self,idx:usize) ->Option<WordCat>{
608-
use tables::wordas wd;
608+
usecrate::tables::wordas wd;
609609
let nidx = idx +self.string[idx..].chars().next().unwrap().len_utf8();
610610
if nidx <self.string.len(){
611611
let nch =self.string[nidx..].chars().next().unwrap();
@@ -617,7 +617,7 @@ impl<'a> UWordBounds<'a> {
617617

618618
#[inline]
619619
fnget_prev_cat(&self,idx:usize) ->Option<WordCat>{
620-
use tables::wordas wd;
620+
usecrate::tables::wordas wd;
621621
if idx >0{
622622
let nch =self.string[..idx].chars().next_back().unwrap();
623623
Some(wd::word_category(nch))
@@ -640,7 +640,7 @@ pub fn new_word_bound_indices<'b>(s: &'b str) -> UWordBoundIndices<'b> {
640640
#[inline]
641641
pubfnnew_unicode_words<'b>(s:&'bstr) ->UnicodeWords<'b>{
642642
usesuper::UnicodeSegmentation;
643-
use tables::util::is_alphanumeric;
643+
usecrate::tables::util::is_alphanumeric;
644644

645645
fnhas_alphanumeric(s:&&str) ->bool{ s.chars().any(|c|is_alphanumeric(c))}
646646
let has_alphanumeric:fn(&&str) ->bool = has_alphanumeric;// coerce to fn pointer

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp