38
38
//! just a required `next` method, operations like `filter` would be impossible to define.
39
39
#![ doc( html_root_url = "https://docs.rs/streaming-iterator/0.1" ) ]
40
40
#![ warn( missing_docs) ]
41
- // for compatibility down to Rust 1.19 (`dyn` needs 1.27)
42
- #![ allow( unknown_lints, bare_trait_objects) ]
43
41
#![ cfg_attr( not( feature = "std" ) , no_std) ]
44
42
45
- #[ cfg( feature = "std" ) ]
46
- extern crate core;
47
-
48
43
use core:: cmp;
49
44
50
45
mod sources;
51
- pub use sources:: { convert, Convert } ;
52
- pub use sources:: { convert_mut, ConvertMut } ;
53
- pub use sources:: { convert_ref, ConvertRef } ;
54
- pub use sources:: { empty, Empty } ;
55
- pub use sources:: { from_fn, FromFn } ;
56
- pub use sources:: { once, Once } ;
57
- pub use sources:: { once_with, OnceWith } ;
58
- pub use sources:: { repeat, Repeat } ;
59
- pub use sources:: { repeat_with, RepeatWith } ;
60
- pub use sources:: { successors, Successors } ;
46
+ pub use crate :: sources:: { convert, Convert } ;
47
+ pub use crate :: sources:: { convert_mut, ConvertMut } ;
48
+ pub use crate :: sources:: { convert_ref, ConvertRef } ;
49
+ pub use crate :: sources:: { empty, Empty } ;
50
+ pub use crate :: sources:: { from_fn, FromFn } ;
51
+ pub use crate :: sources:: { once, Once } ;
52
+ pub use crate :: sources:: { once_with, OnceWith } ;
53
+ pub use crate :: sources:: { repeat, Repeat } ;
54
+ pub use crate :: sources:: { repeat_with, RepeatWith } ;
55
+ pub use crate :: sources:: { successors, Successors } ;
61
56
62
57
/// An interface for dealing with streaming iterators.
63
58
pub trait StreamingIterator {
@@ -692,7 +687,7 @@ where
692
687
693
688
#[ inline]
694
689
fn advance ( & mut self ) {
695
- use ChainState :: * ;
690
+ use crate :: ChainState :: * ;
696
691
697
692
match self . state {
698
693
BothForward | BothBackward => {
@@ -711,7 +706,7 @@ where
711
706
712
707
#[ inline]
713
708
fn is_done ( & self ) -> bool {
714
- use ChainState :: * ;
709
+ use crate :: ChainState :: * ;
715
710
716
711
match self . state {
717
712
BothForward | Front => self . a . is_done ( ) ,
@@ -721,7 +716,7 @@ where
721
716
722
717
#[ inline]
723
718
fn get ( & self ) -> Option < & Self :: Item > {
724
- use ChainState :: * ;
719
+ use crate :: ChainState :: * ;
725
720
726
721
match self . state {
727
722
BothForward | Front => self . a . get ( ) ,
@@ -755,7 +750,7 @@ where
755
750
{
756
751
#[ inline]
757
752
fn advance_back ( & mut self ) {
758
- use ChainState :: * ;
753
+ use crate :: ChainState :: * ;
759
754
760
755
match self . state {
761
756
BothForward | BothBackward => {
@@ -798,7 +793,7 @@ where
798
793
{
799
794
#[ inline]
800
795
fn get_mut ( & mut self ) -> Option < & mut Self :: Item > {
801
- use ChainState :: * ;
796
+ use crate :: ChainState :: * ;
802
797
803
798
match self . state {
804
799
BothForward | Front => self . a . get_mut ( ) ,
@@ -2596,11 +2591,9 @@ mod test {
2596
2591
test ( it. clone ( ) . take_while ( |& i| i < 5 ) , & [ 0 , 1 , 2 , 3 ] ) ;
2597
2592
}
2598
2593
2599
- #[ allow( bare_trait_objects, unknown_lints) ]
2600
- fn _is_object_safe ( _: & StreamingIterator < Item = ( ) > ) { }
2594
+ fn _is_object_safe ( _: & dyn StreamingIterator < Item = ( ) > ) { }
2601
2595
2602
- #[ allow( bare_trait_objects, unknown_lints) ]
2603
- fn _is_object_safe_mut ( _: & StreamingIteratorMut < Item = ( ) > ) { }
2596
+ fn _is_object_safe_mut ( _: & dyn StreamingIteratorMut < Item = ( ) > ) { }
2604
2597
2605
2598
#[ test]
2606
2599
fn empty_iterator ( ) {
0 commit comments