3838//! just a required `next` method, operations like `filter` would be impossible to define.
3939#![ doc( html_root_url = "https://docs.rs/streaming-iterator/0.1" ) ]
4040#![ warn( missing_docs) ]
41- // for compatibility down to Rust 1.19 (`dyn` needs 1.27)
42- #![ allow( unknown_lints, bare_trait_objects) ]
4341#![ cfg_attr( not( feature = "std" ) , no_std) ]
4442
45- #[ cfg( feature = "std" ) ]
46- extern crate core;
47-
4843use core:: cmp;
4944
5045mod 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 } ;
6156
6257/// An interface for dealing with streaming iterators.
6358pub trait StreamingIterator {
@@ -692,7 +687,7 @@ where
692687
693688 #[ inline]
694689 fn advance ( & mut self ) {
695- use ChainState :: * ;
690+ use crate :: ChainState :: * ;
696691
697692 match self . state {
698693 BothForward | BothBackward => {
@@ -711,7 +706,7 @@ where
711706
712707 #[ inline]
713708 fn is_done ( & self ) -> bool {
714- use ChainState :: * ;
709+ use crate :: ChainState :: * ;
715710
716711 match self . state {
717712 BothForward | Front => self . a . is_done ( ) ,
@@ -721,7 +716,7 @@ where
721716
722717 #[ inline]
723718 fn get ( & self ) -> Option < & Self :: Item > {
724- use ChainState :: * ;
719+ use crate :: ChainState :: * ;
725720
726721 match self . state {
727722 BothForward | Front => self . a . get ( ) ,
@@ -755,7 +750,7 @@ where
755750{
756751 #[ inline]
757752 fn advance_back ( & mut self ) {
758- use ChainState :: * ;
753+ use crate :: ChainState :: * ;
759754
760755 match self . state {
761756 BothForward | BothBackward => {
@@ -798,7 +793,7 @@ where
798793{
799794 #[ inline]
800795 fn get_mut ( & mut self ) -> Option < & mut Self :: Item > {
801- use ChainState :: * ;
796+ use crate :: ChainState :: * ;
802797
803798 match self . state {
804799 BothForward | Front => self . a . get_mut ( ) ,
@@ -2596,11 +2591,9 @@ mod test {
25962591 test ( it. clone ( ) . take_while ( |& i| i < 5 ) , & [ 0 , 1 , 2 , 3 ] ) ;
25972592 }
25982593
2599- #[ allow( bare_trait_objects, unknown_lints) ]
2600- fn _is_object_safe ( _: & StreamingIterator < Item = ( ) > ) { }
2594+ fn _is_object_safe ( _: & dyn StreamingIterator < Item = ( ) > ) { }
26012595
2602- #[ allow( bare_trait_objects, unknown_lints) ]
2603- fn _is_object_safe_mut ( _: & StreamingIteratorMut < Item = ( ) > ) { }
2596+ fn _is_object_safe_mut ( _: & dyn StreamingIteratorMut < Item = ( ) > ) { }
26042597
26052598 #[ test]
26062599 fn empty_iterator ( ) {
0 commit comments